-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile
48 lines (36 loc) · 1.32 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
45
46
47
48
# docker build -t telminov/ca .
# docker push telminov/ca
FROM ubuntu:20.04
MAINTAINER telminov <[email protected]>
RUN apt-get clean && apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y \
vim \
supervisor \
curl \
locales \
python3-pip npm
RUN locale-gen ru_RU.UTF-8
ENV LANG ru_RU.UTF-8
ENV LANGUAGE ru_RU:ru
ENV LC_ALL ru_RU.UTF-8
RUN mkdir /var/log/ca
ENV PYTHONUNBUFFERED 1
# copy source
COPY . /opt/ca
WORKDIR /opt/ca
RUN pip3 install -r requirements.txt
RUN cp project/local_settings.sample.py project/local_settings.py
COPY supervisor/supervisord.conf /etc/supervisor/supervisord.conf
COPY supervisor/prod.conf /etc/supervisor/conf.d/ca.conf
EXPOSE 80
VOLUME /data/
VOLUME /conf/
VOLUME /static/
CMD test "$(ls /conf/local_settings.py)" || cp project/local_settings.sample.py /conf/local_settings.py; \
rm project/local_settings.py; ln -s /conf/local_settings.py project/local_settings.py; \
rm -rf static; ln -s /static static; \
rm -rf media; ln -s /media media; \
npm install; rm -rf static/node_modules; mv node_modules static/; \
python3 ./manage.py migrate; \
python3 ./manage.py collectstatic --noinput; \
/usr/bin/supervisord -c /etc/supervisor/supervisord.conf --nodaemon