-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
34 lines (27 loc) · 1017 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
FROM python:3.11-slim-buster
LABEL maintainer="Alert-Hub Dev"
LABEL org.opencontainers.image.source="https://github.com/IFRCGo/alert-hub-backend"
ENV PYTHONUNBUFFERED=1
WORKDIR /code
COPY pyproject.toml poetry.lock /code/
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends \
# Build required packages
gcc libc-dev gdal-bin libproj-dev \
# Django translation
gettext \
# Helper packages
wait-for-it \
# Upgrade pip and install python packages for code
&& pip install --upgrade --no-cache-dir pip poetry \
&& poetry --version \
# Configure to use system instead of virtualenvs
&& poetry config virtualenvs.create false \
&& poetry install --no-root --no-cache --no-interaction \
# Clean-up
&& pip uninstall -y poetry virtualenv-clone virtualenv \
&& apt-get remove -y gcc libc-dev libproj-dev \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /root/.cache/
COPY . /code/