-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
39 lines (27 loc) · 869 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
FROM python:3.7
LABEL maintainer="craweler"
RUN apt-get update
RUN apt-get install -y nano cron tzdata nodejs nodejs-legacy
# set timezone
RUN ln -fs /usr/share/zoneinfo/Asia/Taipei /etc/localtime && dpkg-reconfigure -f noninteractive tzdata
# Install app dependencies
COPY ./requirements.txt /requirements.txt
RUN pip3 install --upgrade pip
RUN pip install meinheld
RUN pip3 install -r /requirements.txt
COPY ./entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
COPY ./start.sh /start.sh
RUN chmod +x /start.sh
# server config
COPY ./gunicorn_conf.py /gunicorn_conf.py
# app
COPY ./app /app/
WORKDIR /app/
# define environment variable
ENV PYTHONPATH=/app
EXPOSE 80
ENTRYPOINT ["/entrypoint.sh"]
# Run the start script, it will check for an /app/prestart.sh script (e.g. for migrations)
# And then will start Gunicorn with Meinheld
CMD ["/start.sh"]