-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
39 lines (28 loc) · 921 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
37
38
39
# base image
FROM python:3.9-alpine
RUN apk update && apk add haproxy
RUN apk update && apk add supervisor
# setup environment variable
ENV DockerHOME=/home/app/musalla
# set work directory
RUN mkdir -p $DockerHOME
# where your code lives
WORKDIR $DockerHOME
# set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# install dependencies
RUN pip install --upgrade pip
# copy whole project to your docker home directory.
COPY . $DockerHOME
# run this command to install all dependencies
RUN pip install -r requirements.txt
# port where the Haproxy app runs
EXPOSE 8001
COPY haproxy.cfg /etc/haproxy/haproxy.cfg
# Add supervisord configuration file
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# Migration
RUN python manage.py makemigrations
RUN python manage.py migrate
CMD ["/usr/bin/supervisord"]