2
2
# since we need some advance binaries for things like pillow and ffmpeg.
3
3
FROM alpine:3.20.0
4
4
5
- # We will base ourselves in root, becuase why not.
6
- WORKDIR /root
5
+ RUN adduser -Ss /bin/bash app -h /app -g root -u 1001
6
+
7
+ WORKDIR /app
7
8
8
9
# Define some user vars we will use for the image.
9
10
# These are read in the docker_octoeverywhere module, so they must not change!
10
- ENV USER=root
11
- ENV REPO_DIR=/root /octoeverywhere
12
- ENV VENV_DIR=/root /octoeverywhere-env
11
+ ENV USER=app
12
+ ENV REPO_DIR=/app /octoeverywhere
13
+ ENV VENV_DIR=/app /octoeverywhere-env
13
14
# This is a special dir that the user MUST mount to the host, so that the data is persisted.
14
15
# If this is not mounted, the printer will need to be re-linked everytime the container is remade.
15
16
ENV DATA_DIR=/data/
@@ -36,7 +37,10 @@ RUN ${VENV_DIR}/bin/pip3 install --require-virtualenv --no-cache-dir -q -r ${REP
36
37
RUN apk add zstd
37
38
RUN ${VENV_DIR}/bin/pip3 install --require-virtualenv --no-cache-dir -q "zstandard>=0.21.0,<0.23.0"
38
39
40
+ # Ensure directories have correct ownership. Having the group set to root(0) and writable by group will allow this to run on openshift
41
+ RUN chown -R 1001:0 /app && chmod -R g+wx /app
42
+
39
43
# For docker, we use our docker_octoeverywhere host to handle the runtime setup and launch of the serivce.
40
44
WORKDIR ${REPO_DIR}
41
45
# Use the full path to the venv, we msut use this [] notation for our ctlc handler to work in the contianer
42
- ENTRYPOINT ["/root /octoeverywhere-env/bin/python" , "-m" , "docker_octoeverywhere" ]
46
+ ENTRYPOINT ["/app /octoeverywhere-env/bin/python" , "-m" , "docker_octoeverywhere" ]
0 commit comments