-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile.prod
65 lines (43 loc) · 1.53 KB
/
Dockerfile.prod
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
FROM node:20-alpine AS build
ARG VITE_AZURE_CLIENT_ID
ARG VITE_AZURE_TENANT_ID
ARG VITE_AZURE_TENANT_NAME
ARG VITE_AZURE_SUSI_AUTH_POLICY_NAME
ARG VITE_AZURE_PASSWORD_RESET_AUTH_POLICY_NAME
ARG VITE_DATAHUB_URL
ARG VITE_SENTRY_DSN
ARG VITE_COMMIT_SHA
ARG VITE_DEPLOY_ENV
ENV VITE_AZURE_CLIENT_ID ${VITE_AZURE_CLIENT_ID}
ENV VITE_AZURE_TENANT_ID ${VITE_AZURE_TENANT_ID}
ENV VITE_AZURE_TENANT_NAME ${VITE_AZURE_TENANT_NAME}
ENV VITE_AZURE_SUSI_AUTH_POLICY_NAME ${VITE_AZURE_SUSI_AUTH_POLICY_NAME}
ENV VITE_AZURE_PASSWORD_RESET_AUTH_POLICY_NAME ${VITE_AZURE_PASSWORD_RESET_AUTH_POLICY_NAME}
ENV VITE_DATAHUB_URL ${VITE_DATAHUB_URL}
ENV VITE_SENTRY_DSN ${VITE_SENTRY_DSN}
ENV VITE_COMMIT_SHA ${VITE_COMMIT_SHA}
ENV VITE_DEPLOY_ENV ${VITE_DEPLOY_ENV}
COPY ./ui/ /tmp/
WORKDIR /tmp
RUN npm ci && npm run build
FROM python:3.11-alpine3.20 AS base
ENV PYTHONUNBUFFERED 1
ENV PYTHONDONTWRITEBYTECODE 1
RUN apk add --no-cache libmagic
FROM base AS deps
ARG POETRY_VERSION=1.6.1
WORKDIR /tmp
RUN pip install --no-cache-dir "poetry==$POETRY_VERSION"
COPY api/pyproject.toml api/poetry.lock ./
# SC2094: -f is a format specifier, not an input file
# hadolint ignore=SC2094
RUN poetry export -f requirements.txt --without-hashes --without dev > requirements.txt
FROM base AS prod
WORKDIR /tmp
COPY --from=deps /tmp/requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
WORKDIR /app
COPY ./api/ ./
COPY --from=build /tmp/build ./static/
ENV PORT 3000
CMD [ "/bin/sh", "-c", "exec gunicorn main:app --bind 0.0.0.0:$PORT --config gunicorn.conf.py" ]