-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
36 lines (27 loc) · 823 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
FROM python:3.11.7-alpine
RUN apk update && \
apk add git && \
apk cache clean && rm -rf /tmp/* /var/tmp/*
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.4.2
# System deps:
RUN pip3 install "poetry==$POETRY_VERSION" gevent
# Configure git
RUN git config --global --add safe.directory "*"
# Copy only requirements to cache them in docker layer
WORKDIR /app/
COPY poetry.lock pyproject.toml /app/
# Project initialization:
RUN poetry config virtualenvs.create false \
&& poetry install -vvv --no-dev --no-interaction --no-ansi
# Set up flask environment
env FLASK_APP=app
# Creating folders, and files for a project:
COPY . /app/