-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (26 loc) · 878 Bytes
/
Copy pathDockerfile
File metadata and controls
32 lines (26 loc) · 878 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
# syntax=docker/dockerfile:1
ARG PYTHON_VERSION=3.10.6
FROM python:${PYTHON_VERSION}-slim as base
# Prevents Python from writing pyc files.
ENV PYTHONDONTWRITEBYTECODE=1
# Keeps Python from buffering stdout and stderr to avoid situations where
# the application crashes without emitting any logs due to buffering.
ENV PYTHONUNBUFFERED=1
ENV VIRTUAL_ENV=/opt/venv
WORKDIR /app
COPY . .
RUN apt-get update && apt-get upgrade -y
RUN apt-get install perl-modules -y
# Activate the virtual environment
RUN python -m venv ${VIRTUAL_ENV}
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
RUN python -m pip install --upgrade pip
RUN pip install -r requirements.txt
#################### RUN THE APPLICATION ######################
# The application can use perl or bash to start
#
# perl activation
# CMD perl app_run/commands/startapi.pl
#
# bash activation
CMD bash app_run/commands/startapi.sh