Skip to content

Commit 1efdc34

Browse files
committed
Improved dockerfile
1 parent 2ace13f commit 1efdc34

File tree

2 files changed

+16
-17
lines changed

2 files changed

+16
-17
lines changed

.dockerignore

+3-9
Original file line numberDiff line numberDiff line change
@@ -140,17 +140,11 @@ test.py
140140
# Other stuff
141141
.env.example
142142
.gitignore
143-
.lint.py
144-
.pylintrc
145-
.travis.yml
143+
.github/
146144
app.json
147145
CHANGELOG.md
148-
CODE_OF_CONDUCT.md
149-
CONTRIBUTING.md
150-
requirements.min.txt
151146
Procfile
152147
pyproject.toml
153148
README.md
154-
runtime.txt
155-
SPONSORS.json
156-
stack.yml
149+
Pipfile
150+
Pipfile.lock

Dockerfile

+13-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
1-
FROM python:3.7-alpine
1+
FROM python:3.9-slim as py
2+
3+
FROM py as build
4+
5+
RUN apt update && apt install -y g++
6+
COPY requirements.min.txt /
7+
RUN pip install --prefix=/inst -U -r /requirements.min.txt
8+
9+
FROM py
10+
211
ENV USING_DOCKER yes
12+
COPY --from=build /inst /usr/local
13+
314
WORKDIR /modmailbot
15+
CMD ["python", "bot.py"]
416
COPY . /modmailbot
5-
RUN export PIP_NO_CACHE_DIR=false \
6-
&& apk update \
7-
&& apk add --update --no-cache --virtual .build-deps alpine-sdk \
8-
&& pip install pipenv \
9-
&& pipenv install --deploy --ignore-pipfile \
10-
&& apk del .build-deps
11-
CMD ["pipenv", "run", "bot"]

0 commit comments

Comments
 (0)