-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathDockerfile
More file actions
85 lines (58 loc) · 1.86 KB
/
Copy pathDockerfile
File metadata and controls
85 lines (58 loc) · 1.86 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
### --- Frontend build --- ###
FROM registry.redhat.io/ubi9/nodejs-22@sha256:57ad03c5db9382cd266af665819f60e5b1490fc27ee589320159df59f9eb453b AS frontend-base
ENV APP_ROOT=/frontend \
HOME=/frontend \
PLATFORM="el8" \
NODEJS_VERSION=22 \
NAME=nodejs
COPY --chown=1001:0 ./frontend /frontend
RUN chmod -R ug+rwx /frontend
WORKDIR "$HOME"
USER 1001
RUN npm install -g pnpm@11 && pnpm install --frozen-lockfile
FROM frontend-base AS frontend-dev
EXPOSE 9000
CMD ["pnpm", "start:dev"]
FROM frontend-base AS frontend-build
RUN pnpm build
### --- Backend --- ###
FROM registry.access.redhat.com/ubi9/python-312:latest@sha256:aebe03384391689993c42998836597e6161ac5340cbc84518c1b0528a1c59ea8 AS backend-base
ENV SERVICETOOLDIR=/backend
COPY --from=ghcr.io/astral-sh/uv:0.12.10@sha256:2bb3ebca0a796a155094a27773d290c4b074572e6107f171d88d086682fd2500 /uv /bin/uv
COPY --chown=1001:0 ./backend /backend
RUN chmod -R ug+rwx $SERVICETOOLDIR
USER root
ENV TZ=UTC
RUN set -ex\
; dnf update -y \
; dnf -y --setopt=tsflags=nodocs install \
gcc-c++ \
git \
openldap-devel \
libffi-devel \
openssl-devel \
file \
make \
libjpeg-turbo \
libjpeg-turbo-devel \
freetype-devel \
libxml2-devel \
libxslt-devel \
; dnf -y clean all && rm -rf /var/cache/yum
USER 1001
ENV UV_COMPILE_BYTECODE=true \
UV_NO_CACHE=true \
UV_PYTHON=3.12
WORKDIR "$SERVICETOOLDIR"
RUN uv sync --frozen --no-dev
ENV PATH="$SERVICETOOLDIR/.venv/bin:$PATH"
FROM backend-base AS backend-dev
EXPOSE 5000
ENTRYPOINT ["gunicorn", "-k", "gevent", "-b", "0.0.0.0:5000", "--limit-request-field_size", "16384", "--reload", "app:app"]
FROM backend-base AS production
ENV SERVICETOOL_RUN=/conf
COPY --chown=1001:0 ./conf /conf
COPY --from=frontend-build --chown=1001:0 /frontend/dist /backend/static
RUN chmod -R ug+rwx $SERVICETOOL_RUN
EXPOSE 5000
ENTRYPOINT ["dumb-init", "--", "/conf/entrypoint.sh"]