forked from sio2project/sioworkers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
48 lines (31 loc) · 1.3 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
FROM python:3.7 as build
ENV PYTHONUNBUFFERED 1
RUN useradd -m oioioi \
&& mkdir -p /sio2/sioworkers \
&& chown -R oioioi:oioioi /sio2
USER oioioi
WORKDIR /sio2
RUN pip install --user virtualenv \
&& /home/oioioi/.local/bin/virtualenv -p python3.7 venv
COPY --chown=oioioi:oioioi setup.py setup.cfg /sio2/sioworkers/
COPY --chown=oioioi:oioioi sio /sio2/sioworkers/sio
COPY --chown=oioioi:oioioi twisted /sio2/sioworkers/twisted
WORKDIR /sio2/sioworkers
RUN . /sio2/venv/bin/activate \
&& pip install .
FROM python:3.7 AS production
ENV PYTHONUNBUFFERED 1
RUN useradd -m oioioi \
&& mkdir -p /sio2/sioworkers \
&& chown -R oioioi:oioioi /sio2
COPY --from=build --chown=oioioi:oioioi /sio2/venv /sio2/venv
COPY --chown=oioioi:oioioi config/supervisord.conf.example /sio2/sioworkers/config/supervisord.conf
COPY --chown=oioioi:oioioi config/supervisord-conf-vars.conf.docker /sio2/sioworkers/config/supervisord-conf-vars.conf
COPY --chown=oioioi:oioioi config/logging.json.example /sio2/sioworkers/config/logging.json
COPY --chown=oioioi:oioioi supervisor.sh /sio2/sioworkers
COPY --chown=oioioi:oioioi docker-entrypoint.sh /sio2
USER oioioi
WORKDIR /sio2/sioworkers
ENV SIOWORKERSD_HOST="web"
ENTRYPOINT [ "/sio2/docker-entrypoint.sh" ]
CMD [ "/sio2/sioworkers/supervisor.sh", "startfg" ]