-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
27 lines (26 loc) · 1.26 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
FROM docker.io/node:alpine as node_build
# needs extra directory for build, add sub directory as well
RUN mkdir -p /app/webpack_bundles
WORKDIR /app
COPY package.json package-lock.json tsconfig.json tsconfig-base.json webpack.config.js /app/
COPY assets /app/assets
COPY js-packages /app/js-packages
RUN npm install && npm run build
FROM docker.io/python:3.12
ENV PYTHONUNBUFFERED=1 DJANGO_SETTINGS_MODULE=secretgraph.settings.docker POETRY_VIRTUALENVS_CREATE=false
RUN useradd -Mr -G www-data secretgraph
RUN mkdir -p /var/lib/secretgraph && chown secretgraph:secretgraph /var/lib/secretgraph
RUN mkdir -p /sockets && chown -R secretgraph:www-data /sockets
RUN mkdir -p /static && chown -R secretgraph:www-data /static
RUN mkdir -p /app/tools
COPY install-deps.sh /
RUN /install-deps.sh
RUN python -m pip install --no-cache poetry hypercorn[h3,uvloop]
COPY manage.py poetry.lock pyproject.toml /app/
WORKDIR /app
RUN poetry install --no-root --no-cache --compile --only main -E server -E proxy -E postgresql -E mysql -E iprestrict
COPY secretgraph /app/secretgraph
COPY tools/start.sh tools/start_docker.sh tools/test.sh tools/compile-messages.sh /app/tools/
RUN ./tools/compile-messages.sh
COPY --from=node_build /app/webpack_bundles /app/webpack_bundles
CMD ["./tools/start_docker.sh"]