-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathDockerfile
37 lines (27 loc) · 1.21 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
FROM python:3.12-slim-bookworm
# Install the needed tools.
RUN apt update && apt install --no-install-recommends -y \
openjdk-17-jre-headless nginx supervisor p7zip-full gcc libc6-dev && \
apt clean && rm -rf /var/lib/apt/lists/*
# Setup Supervisor.
RUN mkdir -p /var/log/supervisor/
COPY ./config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# Setup Nginx.
COPY ./config/nginx-flask.conf /etc/nginx/sites-available/
RUN rm /etc/nginx/sites-enabled/default && \
ln -s /etc/nginx/sites-available/nginx-flask.conf /etc/nginx/sites-enabled/nginx-flask.conf && \
echo "daemon off;" >> /etc/nginx/nginx.conf
# Install and setup uWSGI.
RUN pip3 install --no-cache-dir --upgrade uwsgi pip
COPY ./config/uwsgi.ini /var/www/app/
# Copy requirements and install.
COPY ./requirements.txt /var/www/app/
RUN pip3 install --no-cache-dir -r /var/www/app/requirements.txt
# Copy application.
COPY ./app /var/www/app/
# Extract the compressed database.
RUN 7z x /var/www/app/database/permission_db.7z -o/var/www/app/database/ -y
# The app doesn't run as root, make sure it can access the files.
RUN chmod -R a+rw /var/www/app/
EXPOSE 80
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]