diff --git a/Dockerfile b/Dockerfile index 77a35ca..d3a58bd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,8 +3,9 @@ # Build: docker buildx build -t fingr -f Dockerfile . # Run: docker run -it --rm fingr:latest -FROM python:3.12-alpine3.20 +FROM ubuntu:24.04 +RUN apt-get update && apt-get install -y python3 python3-venv COPY requirements.txt /var/fingr/ RUN python3 -m venv /var/fingr/venv && /var/fingr/venv/bin/pip install wheel \ && /var/fingr/venv/bin/pip install -r /var/fingr/requirements.txt @@ -12,7 +13,7 @@ COPY fingr.py motd.txt* deny.txt* useragent.txt* /var/fingr/ WORKDIR /var/fingr/ -RUN adduser --disabled-password fingr && mkdir /var/fingr/data && chown -R fingr /var/fingr/data +RUN useradd fingr && mkdir /var/fingr/data && chown -R fingr /var/fingr/data USER fingr EXPOSE 7979 diff --git a/Dockerfile.python b/Dockerfile.python new file mode 100644 index 0000000..77a35ca --- /dev/null +++ b/Dockerfile.python @@ -0,0 +1,19 @@ +# syntax=docker/dockerfile:1 + +# Build: docker buildx build -t fingr -f Dockerfile . +# Run: docker run -it --rm fingr:latest + +FROM python:3.12-alpine3.20 + +COPY requirements.txt /var/fingr/ +RUN python3 -m venv /var/fingr/venv && /var/fingr/venv/bin/pip install wheel \ + && /var/fingr/venv/bin/pip install -r /var/fingr/requirements.txt +COPY fingr.py motd.txt* deny.txt* useragent.txt* /var/fingr/ + +WORKDIR /var/fingr/ + +RUN adduser --disabled-password fingr && mkdir /var/fingr/data && chown -R fingr /var/fingr/data +USER fingr + +EXPOSE 7979 +ENTRYPOINT [ "/var/fingr/venv/bin/python3", "fingr.py", "--verbose", "--host", "0.0.0.0" ] diff --git a/compose.yaml b/compose.yaml index 2f45bbc..8a3ca89 100644 --- a/compose.yaml +++ b/compose.yaml @@ -18,6 +18,11 @@ services: target: 7979 protocol: tcp mode: host + volumes: + - type: tmpfs + target: /tmp + tmpfs: + size: 100M depends_on: - redis