-
Notifications
You must be signed in to change notification settings - Fork 12
/
Dockerfile
34 lines (25 loc) · 901 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
FROM python:3.11-buster
RUN apt-get update
# Metadata
LABEL org.opencontainers.image.title="abhisheksr01/zero-2-hero-python-flask-microservice" \
org.opencontainers.image.url="https://hub.docker.com/repository/docker/abhisheksr01/zero-2-hero-python-flask-microservice"
ARG YOUR_ENV
ENV YOUR_ENV=${YOUR_ENV} \
PYTHONFAULTHANDLER=1 \
PYTHONUNBUFFERED=1 \
PYTHONHASHSEED=random \
PIP_NO_CACHE_DIR=off \
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=100 \
POETRY_VERSION=1.7.1
# System deps:
RUN pip install --no-cache-dir "poetry==$POETRY_VERSION"
# Copy only requirements to cache them in docker layer
WORKDIR /code
COPY poetry.lock pyproject.toml /code/
# Project initialization:
RUN poetry config virtualenvs.create false \
&& poetry install --no-dev --no-interaction --no-ansi
# Creating folders, and files for a project:
COPY . /code
CMD ["python", "run.py"]