forked from dotkom/onlineweb4
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Production.Dockerfile
46 lines (32 loc) · 1.03 KB
/
Production.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
38
39
40
41
42
43
44
45
46
FROM node:lts as webpack
LABEL maintainer="Dotkom <[email protected]>"
WORKDIR /srv/app/webpack
COPY assets assets
COPY webpack.server.js .
COPY webpack.production.config.js .
COPY webpack.config.js .
COPY package.json .
COPY .babelrc .
COPY postcss.config.js .
RUN yarn --non-interactive --no-progress --pure-lockfile && \
yarn build:prod
FROM python:3.7-slim-buster
LABEL maintainer="[email protected]"
ENV DJANGO_SETTINGS_MODULE=onlineweb4.settings POETRY_VIRTUALENVS_CREATE=false
WORKDIR /srv/app
RUN apt-get update && apt-get install --no-install-recommends -y \
git \
gcc \
curl \
mime-support \
&& rm -rf /var/lib/apt/lists/*
COPY pyproject.toml poetry.lock ./
RUN pip install poetry
RUN poetry install --no-interaction --no-ansi --no-dev -E prod -E docs
COPY --from=webpack /srv/app/webpack/bundles bundles
COPY --from=webpack /srv/app/webpack/webpack-stats.json webpack-stats.json
COPY . .
RUN python manage.py collectstatic --noinput && \
chmod +x entrypoint.sh
EXPOSE 8000
ENTRYPOINT ["./entrypoint.sh" ]