-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
31 lines (25 loc) · 867 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
FROM python:3.9.7-slim-buster
# Environment variables
ENV POETRY_VERSION="1.1.13" \
POETRY_VIRTUALENVS_CREATE=false \
APP_DIR='/app' \
POSTGRES_HOST="postgres_db" \
POSTGRES_DB="trips" \
POSTGRES_USER="trips" \
POSTGRES_PASSWORD="password" \
REDIS_URL="redis://redis:6379"
# Update packages
RUN apt-get update -y \
&& apt-get install -y build-essential python3-dev python3-setuptools curl \
&& pip install --upgrade --no-cache-dir pip \
&& curl -sSl https://install.python-poetry.org | python - --version "$POETRY_VERSION"
WORKDIR "$APP_DIR"
ADD resources "$APP_DIR/resources"
ADD src "$APP_DIR/src"
ADD *.py "$APP_DIR/"
ADD *.lock "$APP_DIR/"
ADD *.toml "$APP_DIR/"
# Installing project dependencies
RUN $HOME/.local/bin/poetry install --no-dev
# Run the project
CMD ["python", "$APP_DIR/main.py", "-h"]