-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy pathDockerfile_old
More file actions
81 lines (56 loc) · 1.95 KB
/
Copy pathDockerfile_old
File metadata and controls
81 lines (56 loc) · 1.95 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
FROM python:3.11.9-bookworm AS build
ENV PIP_ROOT_USER_ACTION=ignore
RUN --mount=type=cache,target=/root/.cache \
pip install --upgrade pip build
WORKDIR /build/
COPY /LICENSE.txt .
COPY /MANIFEST.in .
COPY /pyproject.toml .
COPY /README.rst .
COPY /requirements.in .
COPY /pyproject.toml .
COPY /VERSION .
RUN python -m build
FROM node:alpine AS node
WORKDIR /dist/
COPY /atlas/static/package*.json .
RUN --mount=type=cache,target=/root/.npm \
npm ci --omit=dev
FROM python:3.11.9-bookworm AS app
ENV PIP_ROOT_USER_ACTION=ignore
RUN apt-get update -qq && apt-get install -y \
postgresql-client
RUN --mount=type=cache,target=/root/.cache \
pip install --upgrade pip setuptools wheel
WORKDIR /dist/
COPY /atlas/configuration/config.py.* ./atlas/configuration/
COPY /atlas/static ./atlas/static
COPY /atlas/templates ./atlas/templates
COPY /atlas/translations ./atlas/translations
COPY --from=node /dist/node_modules ./atlas/static/node_modules
FROM app AS base
COPY /requirements.txt .
RUN --mount=type=cache,target=/root/.cache \
pip install -r requirements.txt
COPY --from=build /build/dist/*.whl .
RUN --mount=type=cache,target=/root/.cache \
pip install --no-deps *.whl
WORKDIR /dist/
COPY data ./data
RUN mkdir install
COPY --chmod=755 ./docker_startup.sh ./docker_startup.sh
COPY atlas ./atlas
COPY --chmod=755 ./install ./install
COPY ./install ./install
RUN ./install/install_app.sh --docker
FROM base AS prod
# Production environment variables for Flask/Atlas
# If you change Atlas directories for config.py, static/, templates/ or translations/,
# you must also change them here or in your own Dockerfile.
ENV FLASK_APP=app.app:create_app
ENV ATLAS_SETTINGS=/dist/atlas/configuration/config.py
ENV ATLAS_STATIC_FOLDER=/dist/atlas/static
# WARNING: ATLAS_TEMPLATE_FOLDER must indicate the parent folder of the templates/ folder !
ENV ATLAS_TEMPLATE_FOLDER=/dist/atlas/
ENV ATLAS_BABEL_TRANSLATION_DIRECTORIES=/dist/atlas/translations
EXPOSE 8080