-
Notifications
You must be signed in to change notification settings - Fork 59
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (26 loc) · 854 Bytes
/
Dockerfile
File metadata and controls
32 lines (26 loc) · 854 Bytes
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.9-slim-bullseye as production
LABEL maintainer="Alex Root Junior <jroot.junior@gmail.com>" \
description="Telegram Bot"
ENV PYTHONPATH "${PYTHONPATH}:/app"
ENV PATH "/app/scripts:${PATH}"
EXPOSE 80
WORKDIR /app
# Install Poetry
RUN set +x \
&& apt update \
&& apt upgrade -y \
&& apt install -y curl gcc build-essential \
&& 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 \
&& rm -rf /var/lib/apt/lists/*
# Add code & install dependencies
COPY pyproject.toml poetry.lock /app/
RUN poetry install -n --only main --no-root
ADD . /app/
RUN chmod +x scripts/* \
&& poetry install -n --only-root \
&& pybabel compile -d locales -D bot
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["run-webhook"]