Skip to content

Commit

Permalink
Dockerfile improvements
Browse files Browse the repository at this point in the history
- use alpine because it’s slimmer than buster
- use entrypoint https://phoenixnap.com/kb/docker-cmd-vs-entrypoint
- extend path to easily invoke sendria binary
- allow to build any version using build-arg
- fix maintainer deprecation https://docs.docker.com/engine/reference/builder/#maintainer-deprecated
  • Loading branch information
chytreg committed Dec 14, 2021
1 parent 6739638 commit e8fe316
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
FROM python:3.8-slim-buster
MAINTAINER Marcin Sztolcman <[email protected]>
FROM python:3.10-alpine as build
LABEL org.opencontainers.image.authors="Marcin Sztolcman <[email protected]>"

RUN useradd --create-home sendria
ARG VERSION=2.2.2

RUN addgroup -S sendria && adduser -S sendria -G sendria
WORKDIR /home/sendria
USER sendria
RUN python3 -m pip install --user sendria==2.2.2
RUN python3 -m pip install --user sendria==$VERSION
ENV PATH="/home/sendria/.local/bin:$PATH"

EXPOSE 1025 1080

CMD ["/home/sendria/.local/bin/sendria", "--foreground", "--db=./mails.sqlite", "--smtp-ip=0.0.0.0", "--http-ip=0.0.0.0"]

ENTRYPOINT [ "sendria", "--foreground", "--db=./mails.sqlite", "--smtp-ip=0.0.0.0", "--http-ip=0.0.0.0" ]

0 comments on commit e8fe316

Please sign in to comment.