-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathDockerfile
54 lines (40 loc) · 1.09 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
####################
# - Stage: Builder
####################
FROM docker.io/python:3.11-slim-bookworm as base-python
WORKDIR /app-src
# Build Variables
ENV PIP_DISABLE_PIP_VERSION_CHECK 1
ENV PIP_NO_CACHE_DIR 1
## Disable Non-Reproducible pip
# Runtime Variables
ENV PYTHONOPTIMIZE 1
ENV PYTHONUNBUFFERED 1
# Get Make
RUN apt update \
&& apt install --no-install-recommends -y \
make libenchant-2-2
# Install Dependencies
COPY ./requirements.txt /app-src/requirements.txt
RUN pip install -r /app-src/requirements.txt
RUN pip install -U sphinx>=7.2.5
# Make
COPY ./ /app-src/
RUN make all
####################
# - Stage: Production
####################
FROM ghcr.io/static-web-server/static-web-server:2-debian as production
RUN apt update \
&& apt upgrade -y \
&& apt install --no-install-recommends -y \
curl
RUN groupadd -g 5000 sws && \
useradd -m -u 5000 -g sws sws
COPY --from=base-python --chown=sws:sws /app-src/build/html/ /app
USER sws
WORKDIR /app
HEALTHCHECK CMD curl --fail http://localhost:3000 || exit 1
ENV SERVER_PORT 3000
ENV SERVER_ROOT /app
ENV SERVER_LOG_REMOTE_ADDRESS false