-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
66 lines (52 loc) · 1.56 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
FROM python:3.6-slim
# roles:
# front - publishes ports to the world; this depends on run/docker-compose though...
# cron - runs cron daemon
LABEL maintainer="ecolex@eaudeweb.ro" \
roles="front,cron" \
name="web"
ENV ECOLEX_HOME=/home/web \
PATH=/home/web/bin:$PATH \
EDW_RUN_WEB_PORT=8000
RUN apt-get -y update &&\
apt-get -y --no-install-recommends install \
vim \
netcat-traditional \
git \
libmariadb-dev-compat \
gcc \
libc-dev-bin \
libc6-dev \
make \
patch \
cron \
curl \
libyajl2 \
procps \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
RUN mkdir -p $ECOLEX_HOME/ecolex \
/www_static \
$ECOLEX_HOME/bin &&\
echo "ECOLEX_HOME=${ECOLEX_HOME}" >> /etc/environment
# Add as few files of possible, we want to cache pip install step for good
COPY docker/docker-entrypoint.sh \
docker/import_updater.sh \
docker/reprocess_from_db.sh \
$ECOLEX_HOME/bin/
COPY docker/ecolex.crontab \
$ECOLEX_HOME/
# Every time you change the value of this variable the cache will be skipped from the next RUN step further
#ARG EDW_ECOLEX_VER
#RUN echo $EDW_ECOLEX_VER
COPY requirements.txt \
requirements-dep.txt \
manage.py \
$ECOLEX_HOME/ecolex/
WORKDIR $ECOLEX_HOME/ecolex
RUN pip install -r requirements-dep.txt
COPY ecolex $ECOLEX_HOME/ecolex/ecolex
# no changes to volume are persistent after declaring it
VOLUME ["/www_static", "${ECOLEX_HOME}/ecolex/logs"]
# USER web # use gosu in the entrypoint
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["run"]