-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
46 lines (30 loc) · 943 Bytes
/
Dockerfile
File metadata and controls
46 lines (30 loc) · 943 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
33
34
35
36
37
38
39
40
41
42
43
44
45
# OS chosen
FROM python:3.12-bookworm AS installation-image
LABEL maintainer="Alexvidalcor"
# Directory to use inside the container to prepare the application
WORKDIR /home/application
# All the files necessary for the application are copied
COPY ["requirements.txt", "main.py", "./"]
COPY ["src", "./src"]
# Set some environment vars
ARG awsRegionDocker
ENV AWS_REGION=$awsRegionDocker
ARG envDeploy
ENV ENVIRONMENT_DEPLOY=$envDeploy
ARG timezone
ENV TZ=$timezone
ARG appName
ENV APP_NAME=$appName
# Set custom logs (only errors and app info)
RUN ln -sf /dev/stdout /home/application/src/logs/app.log \
&& ln -sf /dev/stderr /home/application/src/logs/errors.log
# Install packages needed
RUN apt update \
&& apt install -y \
python3-pip \
python3-venv \
wkhtmltopdf \
&& pip install -r \
requirements.txt
# Run the command that initializes the app
CMD ["python3", "./main.py"]