-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
32 lines (25 loc) · 943 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
FROM python:3.12-slim-bullseye
LABEL maintainer="Togglecorp Dev"
LABEL org.opencontainers.image.source="https://github.com/toggle-corp/ai-chatbot-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 \
# 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 \
# Clean-up
&& rm -rf /root/.cache/pypoetry \
&& 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/*
COPY . /code/