Skip to content

Commit 98dc8ae

Browse files
committed
Minor edits to the dockerfile.
1 parent 83ccdb2 commit 98dc8ae

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

Dockerfile

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
# Start with the lastest alpine, for a solid base,
1+
# Start with the latest alpine, for a solid base,
22
# since we need some advance binaries for things like pillow and ffmpeg.
33
FROM alpine:3.20.0
44

5+
# Create a non-root user to run, so we don't run as root.
6+
# There's no need to run as root and it helps some platforms like openshift.
57
RUN adduser -Ss /bin/bash app -h /app -g root -u 1001
68

79
WORKDIR /app
@@ -12,35 +14,36 @@ ENV USER=app
1214
ENV REPO_DIR=/app/octoeverywhere
1315
ENV VENV_DIR=/app/octoeverywhere-env
1416
# This is a special dir that the user MUST mount to the host, so that the data is persisted.
15-
# If this is not mounted, the printer will need to be re-linked everytime the container is remade.
17+
# If this is not mounted, the printer will need to be re-linked every time the container is remade.
1618
ENV DATA_DIR=/data/
1719

1820
# Install the required packages.
19-
# Any packages here should be mirrored in the install script - and any optaionl pillow packages done inline.
21+
# Any packages here should be mirrored in the install script - and any optional pillow packages done inline.
2022
# GCC, python3-dev, and musl-dev are required for pillow, and jpeg-dev and zlib-dev are required for jpeg support.
2123
RUN apk add --no-cache curl ffmpeg jq python3 python3-dev gcc musl-dev py3-pip py3-virtualenv jpeg-dev libjpeg-turbo-dev zlib-dev py3-pillow libffi-dev
2224

2325
#
24-
# We decided to not run the installer, since the point of the installer is to setup the env, build the launch args, and setup the serivce.
25-
# Instead, we will manually run the smaller subset of commands that are requred to get the env setup in docker.
26+
# We decided to not run the installer, since the point of the installer is to setup the env, build the launch args, and setup the service.
27+
# Instead, we will manually run the smaller subset of commands that are required to get the env setup in docker.
2628
# Note that if this ever becomes too much of a hassle, we might want to revert back to using the installer, and supporting a headless install.
2729
#
2830
RUN virtualenv -p /usr/bin/python3 ${VENV_DIR}
2931
RUN ${VENV_DIR}/bin/python -m pip install --upgrade pip
3032

31-
# Copy the entire repo into the image, do this as late as possible to avoid rebuilding the image everytime the repo changes.
33+
# Copy the entire repo into the image, do this as late as possible to avoid rebuilding the image every time the repo changes.
3234
COPY ./ ${REPO_DIR}/
3335
RUN ${VENV_DIR}/bin/pip3 install --require-virtualenv --no-cache-dir -q -r ${REPO_DIR}/requirements.txt
3436

35-
# Install the optional pacakges for zstandard compression.
37+
# Install the optional packages for zstandard compression.
3638
# THIS VERSION STRING MUST STAY IN SYNC with Compression.ZStandardPipPackageString
3739
RUN apk add zstd
3840
RUN ${VENV_DIR}/bin/pip3 install --require-virtualenv --no-cache-dir -q "zstandard>=0.21.0,<0.23.0"
3941

4042
# Ensure directories have correct ownership. Having the group set to root(0) and writable by group will allow this to run on openshift
4143
RUN chown -R 1001:0 /app && chmod -R g+wx /app
4244

43-
# For docker, we use our docker_octoeverywhere host to handle the runtime setup and launch of the serivce.
45+
# For docker, we use our docker_octoeverywhere host to handle the runtime setup and launch of the service.
4446
WORKDIR ${REPO_DIR}
45-
# Use the full path to the venv, we msut use this [] notation for our ctlc handler to work in the contianer
47+
48+
# Use the full path to the venv, we must use this [] notation for our ctl-c handler to work in the container.
4649
ENTRYPOINT ["/app/octoeverywhere-env/bin/python", "-m", "docker_octoeverywhere"]

0 commit comments

Comments
 (0)