-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
34 lines (25 loc) · 1.07 KB
/
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
# Docker image as python for system requirment (Installing requirements for debian environment)
FROM python:3.11-slim
LABEL org.opencontainers.image.source https://github.com/ibrahimroshdy/multi-arch-github-actions
LABEL org.opencontainers.image.description "A sample project of adding multi-arch support to github actions with docker buildx. Targetting arm64, amd64 and arm/v7 architectures."
# Keeps Python from generating .pyc files in the container
ENV PYTHONDONTWRITEBYTECODE 1
# Turns off buffering for easier container logging
ENV PYTHONUNBUFFERED 1
RUN python -m venv /opt/venv
# Make sure we use the venv (virtual environment)
ENV PATH="/opt/venv/bin:$PATH"
# Install python packages and dependencies
RUN pip install poetry && \
poetry config virtualenvs.create false
# copy poetry packages file
COPY pyproject.toml ./
RUN poetry install --no-interaction --no-ansi
# Setup workdir for contaier
WORKDIR /app
# copying working files at workdir
COPY simple_loop.py simple_loop.py
# Make file executable
RUN chmod +x simple_loop.py
# Entrypoint
CMD ["python","simple_loop.py"]