-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
38 lines (26 loc) · 919 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
38
# App build base
FROM python:3.11.4-slim-buster AS app-builder
ENV PYTHONDONTWRITEBYTECODE 1 \
PYTHONUNBUFFERED 1 \
PYTHONPATH="${PYTHONPATH}:/app/backend"
RUN echo $POETRY_VERSION
RUN apt-get update -y && \
apt-get install -y postgresql gcc libpq-dev musl-dev
RUN pip install --upgrade pip
RUN pip install "poetry==1.7.0"
WORKDIR /app/backend
COPY ./backend/poetry.lock ./backend/pyproject.toml ./
RUN poetry config virtualenvs.create false && poetry install --no-interaction --no-ansi --no-root
# App build dev
FROM app-builder as app-dev
CMD python manage.py runserver 0.0.0.0:8000
# App build test
FROM app-builder as app-test
RUN poetry config virtualenvs.create false && poetry install --no-interaction --no-ansi --no-root --only test
# Web build
FROM node:17-alpine AS web-builder
FROM web-builder as web-dev
WORKDIR /app/frontend
COPY ./frontend/package*.json ./
RUN npm install
CMD npm start