-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
34 lines (31 loc) · 1.24 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
FROM python:3.9-buster
# install nginx
RUN apt-get update && apt-get install nginx vim emacs libmariadbclient-dev default-libmysqlclient-dev libssl-dev -y
COPY /conf/nginx.default /etc/nginx/sites-available/default
RUN ln -sf /dev/stdout /var/log/nginx/access.log \
&& ln -sf /dev/stderr /var/log/nginx/error.log
# install mysqlclient seperately because it's only in prod not dev.
RUN pip install mysqlclient
# copy source and install dependencies
RUN mkdir -p /opt/app
RUN mkdir -p /opt/app/libs/cal-sync-magic
COPY requirements.txt /opt/app/
RUN pip install --upgrade pip && pip install -r /opt/app/requirements.txt
RUN mkdir -p /opt/app/pip_cache
COPY main /opt/app/main
COPY cal-sync-magic/*.py /opt/app/libs/cal-sync-magic
COPY cal-sync-magic/*.cfg /opt/app/libs/cal-sync-magic
COPY cal-sync-magic/*.ini /opt/app/libs/cal-sync-magic
COPY cal-sync-magic/cal_sync_magic /opt/app/libs/cal-sync-magic/cal_sync_magic
COPY static /opt/app/static
COPY pigscanfly /opt/app/pigscanfly
COPY templates /opt/app/templates
COPY scripts/start-server.sh /opt/app/
COPY *.py /opt/app/
WORKDIR /opt/app/
RUN chown -R www-data:www-data /opt/app
RUN cd /opt/app/libs/cal-sync-magic; pip install -e .
# start server
EXPOSE 80
STOPSIGNAL SIGTERM
CMD ["/opt/app/start-server.sh"]