added k8s manifests
This commit is contained in:
34
Dockerfile
Normal file
34
Dockerfile
Normal file
@@ -0,0 +1,34 @@
|
||||
# Use RHEL 9 UBI as the base
|
||||
FROM registry.access.redhat.com/ubi9/ubi-minimal:latest
|
||||
|
||||
# Define Mattermost version and architecture
|
||||
ARG MM_VERSION=11.4.0
|
||||
ARG MM_PACKAGE=mattermost-${MM_VERSION}-linux-amd64.tar.gz
|
||||
|
||||
# Set environment variables
|
||||
ENV PATH="/mattermost/bin:${PATH}"
|
||||
ENV MM_INSTALL_TYPE=docker
|
||||
|
||||
# 1. Install necessary dependencies
|
||||
# 2. Create mattermost user/group for security
|
||||
# 3. Download and extract the binary
|
||||
RUN microdnf update -y && \
|
||||
microdnf install -y tar gzip shadow-utils ca-certificates findutils && \
|
||||
groupadd -g 2000 mattermost && \
|
||||
useradd -u 2000 -g mattermost -m -s /sbin/nologin mattermost && \
|
||||
curl -L https://releases.mattermost.com/${MM_VERSION}/${MM_PACKAGE} | tar -xz && \
|
||||
mkdir -p /mattermost/data /mattermost/plugins /mattermost/client/plugins && \
|
||||
chown -R mattermost:mattermost /mattermost && \
|
||||
microdnf clean all
|
||||
|
||||
# Set the working directory
|
||||
WORKDIR /mattermost
|
||||
|
||||
# Mattermost uses these ports
|
||||
EXPOSE 8065 8067
|
||||
|
||||
# Switch to non-root user
|
||||
USER mattermost
|
||||
|
||||
# Start the Mattermost server
|
||||
CMD ["mattermost"]
|
||||
Reference in New Issue
Block a user