-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathDockerfile-dev
More file actions
73 lines (50 loc) · 1.52 KB
/
Dockerfile-dev
File metadata and controls
73 lines (50 loc) · 1.52 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
FROM python:3.11-slim as base
ENV PYTHONUNBUFFERED 1
ENV DEBIAN_FRONTEND=noninteractive
FROM base AS builder
RUN set -xe; \
apt-get update && apt-get install -y \
-o APT::Install-Recommends=false \
-o APT::Install-Suggests=false \
build-essential\
gcc\
g++ \
libc-dev \
libpq-dev \
git \
zlib1g-dev \
curl \
wget \
ca-certificates \
nodejs \
npm
ADD requirements/base.txt /requirements.txt
RUN pip install --prefix=/install -r /requirements.txt
ADD requirements/dev.txt /requirements.txt
RUN pip install --prefix=/install -r /requirements.txt
FROM node:11-alpine AS nodebuilder
COPY . /app
WORKDIR /app
RUN npm install
RUN npx gulp compile
FROM base
RUN groupadd --gid=800 -r unprivileged && useradd --uid=800 --gid=800 --no-log-init -r unprivileged
RUN set -xe; \
apt-get update && apt-get install -y \
-o APT::Install-Recommends=false \
-o APT::Install-Suggests=false \
locales \
libpq-dev \
tzdata
RUN dpkg-reconfigure -f noninteractive tzdata
COPY --from=builder /install /usr/local
COPY . /opt/app
COPY --from=nodebuilder /app/build /opt/app/moscowdjango/static
RUN chmod +x /opt/app/entrypoint.sh
WORKDIR /opt/app
RUN chown -R unprivileged:unprivileged /opt/app
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
USER unprivileged
EXPOSE 8000
ENTRYPOINT ["/opt/app/entrypoint.sh"]
CMD ["runserver"]