updated dockerfile and deployment
This commit is contained in:
27
Dockerfile
27
Dockerfile
@@ -6,23 +6,33 @@ ARG MM_VERSION=11.4.0
|
|||||||
ARG MM_PACKAGE=mattermost-${MM_VERSION}-linux-amd64.tar.gz
|
ARG MM_PACKAGE=mattermost-${MM_VERSION}-linux-amd64.tar.gz
|
||||||
|
|
||||||
# Set environment variables
|
# Set environment variables
|
||||||
ENV PATH="/mattermost/bin:${PATH}"
|
# We include the bin in the PATH and explicitly set the working dir
|
||||||
|
ENV PATH="/opt/mattermost/bin:${PATH}"
|
||||||
ENV MM_INSTALL_TYPE=docker
|
ENV MM_INSTALL_TYPE=docker
|
||||||
|
|
||||||
# 1. Install necessary dependencies
|
# 1. Install necessary dependencies
|
||||||
# 2. Create mattermost user/group for security
|
# 2. Create mattermost user/group
|
||||||
# 3. Download and extract the binary
|
# 3. Create the target directory FIRST
|
||||||
|
# 4. Download, extract, and move
|
||||||
RUN microdnf update -y && \
|
RUN microdnf update -y && \
|
||||||
microdnf install -y tar gzip shadow-utils ca-certificates findutils && \
|
microdnf install -y tar gzip shadow-utils ca-certificates findutils && \
|
||||||
groupadd -g 2000 mattermost && \
|
groupadd -g 2000 mattermost && \
|
||||||
useradd -u 2000 -g mattermost -m -s /sbin/nologin mattermost && \
|
useradd -u 2000 -g mattermost -m -s /sbin/nologin mattermost && \
|
||||||
|
# Create the directory before moving things into it
|
||||||
|
mkdir -p /opt/mattermost && \
|
||||||
curl -L https://releases.mattermost.com/${MM_VERSION}/${MM_PACKAGE} | tar -xz && \
|
curl -L https://releases.mattermost.com/${MM_VERSION}/${MM_PACKAGE} | tar -xz && \
|
||||||
mkdir -p /mattermost/data /mattermost/plugins /mattermost/client/plugins && \
|
# Move extracted contents into /opt/mattermost
|
||||||
chown -R mattermost:mattermost /mattermost && \
|
mv mattermost/* /opt/mattermost/ && \
|
||||||
|
rm -rf mattermost && \
|
||||||
|
# Create required subdirectories
|
||||||
|
mkdir -p /opt/mattermost/config /opt/mattermost/data /opt/mattermost/logs \
|
||||||
|
/opt/mattermost/plugins /opt/mattermost/client/plugins /opt/mattermost/bleve-indexes && \
|
||||||
|
# Fix permissions
|
||||||
|
chown -R mattermost:mattermost /opt/mattermost && \
|
||||||
microdnf clean all
|
microdnf clean all
|
||||||
|
|
||||||
# Set the working directory
|
# Set the working directory - Mattermost looks for config/ relative to this path
|
||||||
WORKDIR /mattermost
|
WORKDIR /opt/mattermost
|
||||||
|
|
||||||
# Mattermost uses these ports
|
# Mattermost uses these ports
|
||||||
EXPOSE 8065 8067
|
EXPOSE 8065 8067
|
||||||
@@ -31,4 +41,5 @@ EXPOSE 8065 8067
|
|||||||
USER mattermost
|
USER mattermost
|
||||||
|
|
||||||
# Start the Mattermost server
|
# Start the Mattermost server
|
||||||
CMD ["mattermost"]
|
# Explicitly point to the config file to avoid the "Permission Denied" on /mattermost
|
||||||
|
CMD ["mattermost", "--config", "/opt/mattermost/config/config.json"]
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ spec:
|
|||||||
value: postgres
|
value: postgres
|
||||||
- name: MM_SQLSETTINGS_DATASOURCE
|
- name: MM_SQLSETTINGS_DATASOURCE
|
||||||
value: postgres://mattermost:mattermost@postgres:5432/mattermost?sslmode=disable&connect_timeout=10
|
value: postgres://mattermost:mattermost@postgres:5432/mattermost?sslmode=disable&connect_timeout=10
|
||||||
image: gitea.lab.cudanet.org/cudanet/mattermost/mattermost:v11.4.0
|
image: gitea.lab.cudanet.org/cudanet/mattermost/mattermost:v11.4.0_2
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
name: mattermost
|
name: mattermost
|
||||||
ports:
|
ports:
|
||||||
|
|||||||
Reference in New Issue
Block a user