-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
44 lines (32 loc) · 1.17 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
# docker build -t telminov/sms-service .
FROM g10k/filebeat
MAINTAINER telminov <[email protected]>
EXPOSE 8080
# directory for sqlite3 database
VOLUME /data/
# django settings
VOLUME /conf/
# django static-files
VOLUME /static/
# django logs
VOLUME /logs/
RUN apt-get update && \
apt-get install -y \
vim \
supervisor
RUN mkdir /var/log/sms-service
# copy source
COPY . /opt/sms-service
WORKDIR /opt/sms-service
RUN pip3 install -r requirements.txt
RUN cp project/local_settings.sample.py project/local_settings.py
COPY supervisor/prod.conf /etc/supervisor/conf.d/sms-service.conf
CMD test "$(ls /conf/local_settings.py)" || cp project/local_settings.py /conf/local_settings.py; \
test "$(ls /conf/filebeat.yml)" || cp /etc/filebeat/filebeat.yml /conf/filebeat.yml; \
rm project/local_settings.py; ln -s /conf/local_settings.py project/local_settings.py; \
rm /etc/filebeat/filebeat.yml; ln -s /conf/filebeat.yml /etc/filebeat/filebeat.yml; \
rm -rf static; ln -s /static static; \
service filebeat start; \
python3 ./manage.py migrate; \
python3 ./manage.py collectstatic --noinput; \
/usr/bin/supervisord