-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
41 lines (31 loc) · 924 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
37
38
39
40
41
FROM python:3.11.1-slim-bullseye
ARG DISCORD_TOKEN
ARG CHANNEL_ID
ARG HOUR_TO_SEND
ARG TZ
ENV DISCORD_TOKEN=${DISCORD_TOKEN}
ENV CHANNEL_ID=${CHANNEL_ID}
ENV HOUR_TO_SEND=${HOUR_TO_SEND}
ENV TZ=${TZ}
# Configure Poetry
ENV POETRY_VERSION=1.2.2
ENV POETRY_HOME=/opt/poetry
ENV POETRY_VENV=/opt/poetry-venv
ENV POETRY_CACHE_DIR=/opt/.cache
# Turns off buffering for easier container logging
ENV PYTHONUNBUFFERED 1
# Install poetry separated from system interpreter
RUN python3 -m venv $POETRY_VENV \
&& $POETRY_VENV/bin/pip install -U pip setuptools \
&& $POETRY_VENV/bin/pip install poetry==${POETRY_VERSION}
# Add `poetry` to PATH
ENV PATH="${PATH}:${POETRY_VENV}/bin"
WORKDIR /app
# Install dependencies
COPY poetry.lock pyproject.toml ./
RUN poetry config virtualenvs.create false
RUN poetry install --no-root
# Run your app
COPY . .
ENTRYPOINT ["poetry"]
CMD [ "run", "python", "-m", "citation_station"]