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

10
build_docker_image.sh Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/bash
set -e
venv/bin/python -m build
mkdir -p docker/build
cp dist/sspoc-*.whl docker/build/
cp docker/Dockerfile docker/build/Dockerfile
cp docker/uwsgi.ini docker/build/uwsgi.ini
docker build docker/build --tag sspoc:latest

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

View File

@@ -17,6 +17,8 @@ classifiers = [
"Operating System :: OS Independent",
]
dependencies = [
"gevent",
"greenlet",
"flask >= 3.0",
'cryptography>=42.0.0',
]