-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
37 lines (27 loc) · 877 Bytes
/
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
FROM node:20
ARG BUILD_MODE=production
ENV NODE_ENV=$BUILD_MODE
WORKDIR /app
COPY ["package.json", "package-lock.json", "./"]
RUN npm ci
COPY ["webpack.*", "./"]
COPY ["assets", "./assets/"]
RUN npm run-script build-${BUILD_MODE}
FROM python:3.11
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV PYTHONPATH="${PYTHONPATH}:/app"
ENV DJANGO_SETTINGS_MODULE=foxtail.settings
ENV GUNICORN_WORKERS=2
# add a user/group for our app to run under
RUN groupadd -r abc -g 5678 && useradd --no-log-init -u 5678 -r -g abc abc
WORKDIR /app
COPY ["requirements.txt", "./"]
RUN pip install --no-cache-dir -r requirements.txt
COPY --from=0 /app/assets/generated /app/assets/generated
COPY [".", "./"]
# Ensures file ownership is correct
RUN chown -R abc /app
USER abc
EXPOSE 8000
CMD django-admin collectstatic --noinput;gunicorn --bind 0.0.0.0:8000 foxtail.wsgi:application