1
- # Start with the lastest alpine, for a solid base,
1
+ # Start with the latest alpine, for a solid base,
2
2
# since we need some advance binaries for things like pillow and ffmpeg.
3
3
FROM alpine:3.20.0
4
4
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.
5
7
RUN adduser -Ss /bin/bash app -h /app -g root -u 1001
6
8
7
9
WORKDIR /app
@@ -12,35 +14,36 @@ ENV USER=app
12
14
ENV REPO_DIR=/app/octoeverywhere
13
15
ENV VENV_DIR=/app/octoeverywhere-env
14
16
# 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.
16
18
ENV DATA_DIR=/data/
17
19
18
20
# 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.
20
22
# GCC, python3-dev, and musl-dev are required for pillow, and jpeg-dev and zlib-dev are required for jpeg support.
21
23
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
22
24
23
25
#
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.
26
28
# 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.
27
29
#
28
30
RUN virtualenv -p /usr/bin/python3 ${VENV_DIR}
29
31
RUN ${VENV_DIR}/bin/python -m pip install --upgrade pip
30
32
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.
32
34
COPY ./ ${REPO_DIR}/
33
35
RUN ${VENV_DIR}/bin/pip3 install --require-virtualenv --no-cache-dir -q -r ${REPO_DIR}/requirements.txt
34
36
35
- # Install the optional pacakges for zstandard compression.
37
+ # Install the optional packages for zstandard compression.
36
38
# THIS VERSION STRING MUST STAY IN SYNC with Compression.ZStandardPipPackageString
37
39
RUN apk add zstd
38
40
RUN ${VENV_DIR}/bin/pip3 install --require-virtualenv --no-cache-dir -q "zstandard>=0.21.0,<0.23.0"
39
41
40
42
# Ensure directories have correct ownership. Having the group set to root(0) and writable by group will allow this to run on openshift
41
43
RUN chown -R 1001:0 /app && chmod -R g+wx /app
42
44
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 .
44
46
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.
46
49
ENTRYPOINT ["/app/octoeverywhere-env/bin/python" , "-m" , "docker_octoeverywhere" ]
0 commit comments