-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
51 lines (42 loc) · 1.05 KB
/
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
47
48
49
50
51
# syntax=docker/dockerfile:1
# Base image
FROM python:3.10.6-slim-buster AS development_build
ARG DJANGO_ENV
ENV DJANGO_ENV=${DJANGO_ENV} \
# python
PYTHONFAULTHANDLER=1 \
PYTHONUNBUFFERED=0 \
PYTHONHASHSEED=random \
# pip
PIP_NO_CACHE_DIR=off \
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=100 \
# poetry
POETRY_VERSION=1.1.14 \
POETRY_VIRTUALENVS_CREATE=false \
POETRY_CACHE_DIR='/var/cache/pypoetry'
# System deps
RUN apt-get update \
&& apt-get install --no-install-recommends -y \
bash \
build-essential \
curl \
gettext \
git \
libpq-dev \
wget \
python-dev \
# Cleaning cache:
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* \
&& pip install "poetry==$POETRY_VERSION" && poetry --version
# set work directory
WORKDIR /code
COPY pyproject.toml poetry.lock /code/
# Install dependencies
RUN poetry install
# copy project
COPY . .
# expose port
EXPOSE 8000
# start server
CMD ["python", "manage.py", "runserver"]