-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
59 lines (41 loc) · 1.29 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
52
53
54
55
56
57
58
59
# Dockerfile
# Uses multi-stage builds requiring Docker 17.05 or higher
# See https://docs.docker.com/develop/develop-images/multistage-build/
# Creating a python base with shared environment variables
FROM python:3.11-bullseye as python-base
# non interactive frontend
ENV DEBIAN_FRONTEND=noninteractive
# install requiremnts for python install
RUN apt-get update \
&& apt-get install --no-install-recommends -y \
software-properties-common \
git \
curl \
build-essential \
libsqlite3-mod-spatialite \
gdal-bin
ENV POETRY_VERSION=1.3.1 \
POETRY_HOME="/opt/poetry" \
POETRY_VIRTUALENVS_IN_PROJECT=true \
POETRY_NO_INTERACTION=1
# add poetry home to path
ENV PATH="$POETRY_HOME/bin:$PATH"
# install virtualenv
RUN pip install -U virtualenv
# Install Poetry - respects $POETRY_VERSION & $POETRY_HOME
RUN curl -sSL https://install.python-poetry.org | python
# testing stage
FROM python-base as testing
WORKDIR /code
ENTRYPOINT ["/code/docker/entrypoint.test.sh"]
# development stage
FROM python-base as development
WORKDIR /code
ENTRYPOINT ["/code/docker/entrypoint.dev.sh"]
# production stage
FROM python-base as production
WORKDIR /code
COPY . /code/
# install all dependencies
RUN poetry install --no-dev --extras asgi
ENTRYPOINT [ "/code/docker/entrypoint.prod.sh"]