Skip to content

Commit

Permalink
Switch to ubuntu based image
Browse files Browse the repository at this point in the history
  • Loading branch information
ways committed Oct 3, 2024
1 parent db40067 commit 6ca6115
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@
# 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
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
Expand Down
19 changes: 19 additions & 0 deletions Dockerfile.python
Original file line number Diff line number Diff line change
@@ -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" ]
5 changes: 5 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ services:
target: 7979
protocol: tcp
mode: host
volumes:
- type: tmpfs
target: /tmp
tmpfs:
size: 100M
depends_on:
- redis

Expand Down

0 comments on commit 6ca6115

Please sign in to comment.