added docker image

This commit is contained in:
2024-02-15 08:56:48 +08:00
parent 219a7910ad
commit ca5959d81d
8 changed files with 38 additions and 0 deletions

18
docker/Dockerfile Normal file
View File

@@ -0,0 +1,18 @@
FROM alpine:latest
MAINTAINER Oggioni Walter <oggioni.walter@gmail.com>
RUN apk update
RUN apk add python3 py3-pip uwsgi uwsgi-python3 graphviz uwsgi-gevent3
RUN mkdir /srv/http
RUN mkdir /var/sspoc
WORKDIR /var/sspoc
RUN python -m venv venv
ADD uwsgi.ini /var/sspoc
ADD sspoc-*.whl /
RUN venv/bin/pip install /sspoc-*.whl && rm /sspoc-*.whl
VOLUME /srv/http
WORKDIR /srv/http
ENTRYPOINT ["uwsgi"]
EXPOSE 1910/tcp
EXPOSE 1910/udp
USER nobody
CMD [ "--ini", "/var/sspoc/uwsgi.ini" ]

8
docker/uwsgi.ini Normal file
View File

@@ -0,0 +1,8 @@
[uwsgi]
#logformat = "%(proto) - %(method) %(uri) %(status) %(addr)
need-plugin=/usr/lib/uwsgi/python_plugin.so
need-plugin=/usr/lib/uwsgi/gevent3_plugin.so
socket = :1910
module = sspoc.server:app
virtualenv = /var/sspoc/venv
gevent = 1000