forked from minvws/nl-kat-rocky
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.dev
50 lines (33 loc) · 1.35 KB
/
Dockerfile.dev
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
# syntax=docker/dockerfile:1
FROM node:18-bullseye AS builder
WORKDIR /app
COPY nl-kat-rocky/package.json nl-kat-rocky/yarn.lock .
COPY nl-kat-rocky/assets assets
RUN yarn --ignore-engines && yarn build
FROM python:3.8
ARG USER_UID=1000
ARG USER_GID=1000
ENTRYPOINT ["/app/rocky/entrypoint.sh"]
RUN groupadd --gid $USER_GID rocky
RUN adduser --disabled-password --gecos '' --uid $USER_UID --gid $USER_GID rocky
WORKDIR /app/rocky
RUN --mount=type=cache,target=/var/cache/apt \
apt-get update \
&& apt-get -y upgrade \
&& apt-get install -y --no-install-recommends gettext \
&& rm -rf /var/lib/apt/lists/*
# Build with "docker build --build-arg ENVIRONMENT=dev" to install dev
# dependencies
ARG ENVIRONMENT
COPY nl-kat-rocky/requirements-check.txt nl-kat-rocky/requirements-dev.txt .
RUN --mount=type=cache,target=/root/.cache pip install --upgrade pip \
&& pip install -r requirements-dev.txt
COPY nl-kat-octopoes/ /tmp/octopoes
RUN cd /tmp/octopoes && python setup.py bdist_wheel
RUN pip install /tmp/octopoes/dist/octopoes*.whl
COPY nl-kat-rocky .
# These files need to be available when we run collectstatic
COPY --link --from=builder /app/assets/dist assets/dist
RUN export SECRET_KEY="secret" && python manage.py collectstatic -l && python manage.py compilemessages
USER rocky
CMD ["uwsgi", "--ini", "uwsgi.ini", "--wsgi-file", "rocky/wsgi.py"]