-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
36 lines (23 loc) · 840 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
35
36
# syntax=docker/dockerfile:1
FROM python:3.9-slim AS base
WORKDIR /worker
# To install poetry
RUN apt-get update && \
apt-get install -y curl
# To print directly to stdout instead of buffering output
ENV PYTHONUNBUFFERED=true
# Upgrade pip and install Poetry
RUN python -m pip install --upgrade pip && \
curl -sSL https://install.python-poetry.org | POETRY_HOME=/opt/poetry python && \
cd /usr/local/bin && \
ln -s /opt/poetry/bin/poetry && \
poetry config virtualenvs.create false
# Copy poetry.lock* in case it doesn't exist in the repo
COPY pyproject.toml poetry.lock* ./
RUN poetry install --no-root
COPY . .
CMD ["inv", "worker", "-e", "production"]
# ==================== debug ====================
FROM base AS debug
RUN poetry install --no-root --with dev
CMD ["inv", "worker", "-e", "development"]