-
-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathDockerfile
46 lines (35 loc) · 1 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
35
36
37
38
39
40
41
42
43
44
45
46
# Dockerfile
FROM python:3.10
# Install system dependencies
RUN apt-get -y update && \
apt-get -y install --no-install-recommends \
ffmpeg \
imagemagick \
procps \
fonts-liberation && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Set up locale
RUN apt-get update && apt-get install -y locales && \
locale-gen C.UTF-8 && \
/usr/sbin/update-locale LANG=C.UTF-8 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
ENV LC_ALL C.UTF-8
# Modify ImageMagick policy to allow text operations
RUN sed -i 's/none/read,write/g' /etc/ImageMagick-6/policy.xml
# Set environment variables
# ENV IMAGEMAGICK_BINARY=/usr/bin/convert
ENV PYTHONUNBUFFERED=1
WORKDIR /home/app
# Copy only necessary files
COPY requirements.txt .
COPY Backend/ Backend/
# Install Python dependencies
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
WORKDIR /home/app/Backend
# copy the .env file
COPY .env .
# Default command
CMD ["python", "main.py"]