Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve docker image and documentation #44

Merged
merged 5 commits into from Sep 10, 2019
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -3,3 +3,4 @@ pkg_venv
*.egg-info
contrib
config_examples
Dockerfile
@@ -1,11 +1,37 @@
FROM python:3-slim
FROM docker.io/python:3.7-alpine
LABEL maintainer="Vladislav Yarmak <vladislav-ex-src@vm-0.com>"

ARG UID=18721
ARG USER=mta-sts
ARG GID=18721

RUN true \
&& addgroup --gid "$GID" "$USER" \
&& adduser \
--disabled-password \
--gecos "" \
--home "/build" \
--ingroup "$USER" \
--no-create-home \
--uid "$UID" \
"$USER" \
&& true

COPY . /build
WORKDIR /build
RUN pip3 install --no-cache-dir .[sqlite,redis] && pip3 install --no-cache-dir uvloop
RUN true \
&& apk add --no-cache --virtual .build-deps alpine-sdk libffi-dev \
&& apk add --no-cache libffi \
&& pip3 install --no-cache-dir .[sqlite,redis] \
&& pip3 install --no-cache-dir uvloop \
&& mkdir /var/lib/mta-sts \
&& chown -R "$USER:$USER" /build /var/lib/mta-sts \
&& apk del .build-deps \
&& true
COPY docker-config.yml /etc/mta-sts-daemon.yml

USER $USER

VOLUME [ "/var/lib/mta-sts" ]
EXPOSE 8461/tcp
ENTRYPOINT [ "mta-sts-daemon" ]
@@ -68,7 +68,8 @@ Run

```bash
docker volume create mta-sts-cache
docker run -dit \
docker run -d \
--security-opt no-new-privileges \
-v mta-sts-cache:/var/lib/mta-sts \
-p 127.0.0.1:8461:8461 \
--restart unless-stopped \
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.