|
| 1 | +FROM ubuntu:20.04 |
| 2 | +ENV DEBIAN_FRONTEND noninteractive |
| 3 | + |
| 4 | +RUN apt-get update && apt-get -y dist-upgrade \ |
| 5 | + && apt-get -y install libffi-dev libsasl2-dev python3-dev libyaml-dev sudo \ |
| 6 | + libldap2-dev libssl-dev python3-pip python3-setuptools python3-venv \ |
| 7 | + mysql-client nginx uwsgi uwsgi-plugin-python3 uwsgi-plugin-gevent-python3 \ |
| 8 | + && pip3 install mysql-connector-python \ |
| 9 | + && rm -rf /var/cache/apt/archives/* |
| 10 | + |
| 11 | +RUN useradd -m -s /bin/bash iris |
| 12 | + |
| 13 | +COPY src /home/iris/source/src |
| 14 | +COPY setup.py /home/iris/source/setup.py |
| 15 | +COPY MANIFEST.in /home/iris/source/MANIFEST.in |
| 16 | +COPY README.md /home/iris/source/README.md |
| 17 | + |
| 18 | +WORKDIR /home/iris |
| 19 | + |
| 20 | +RUN chown -R iris:iris /home/iris/source /var/log/nginx /var/lib/nginx \ |
| 21 | + && sudo -Hu iris mkdir -p /home/iris/var/log/uwsgi /home/iris/var/log/nginx /home/iris/var/run /home/iris/var/relay \ |
| 22 | + && sudo -Hu iris python3 -m venv /home/iris/env \ |
| 23 | + && sudo -Hu iris /bin/bash -c 'source /home/iris/env/bin/activate && python3 -m pip install -U pip wheel && cd /home/iris/source && pip install .' |
| 24 | + |
| 25 | +COPY . /home/iris |
| 26 | +COPY ops/config/systemd /etc/systemd/system |
| 27 | +COPY ops/daemons /home/iris/daemons |
| 28 | +COPY ops/daemons/uwsgi-docker.yaml /home/iris/daemons/uwsgi.yaml |
| 29 | +COPY db /home/iris/db |
| 30 | +COPY configs /home/iris/config |
| 31 | +COPY healthcheck /tmp/status |
| 32 | +COPY ops/entrypoint.py /home/iris/entrypoint.py |
| 33 | + |
| 34 | +RUN chown -R iris:iris /home/iris/ |
| 35 | + |
| 36 | +EXPOSE 16649 |
| 37 | + |
| 38 | +CMD ["sudo", "-EHu", "iris", "bash", "-c", "source /home/iris/env/bin/activate && python -u /home/iris/entrypoint.py"] |
0 commit comments