add Dockerfile

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2020-06-17 22:40:05 +02:00
parent d4002b5ca9
commit 6d7f588baa
No known key found for this signature in database
GPG Key ID: 4EF064D0E6D63020
2 changed files with 41 additions and 0 deletions

3
.dockerignore Normal file
View File

@ -0,0 +1,3 @@
.venv
__pycache__
Dockerfile

38
Dockerfile Normal file
View File

@ -0,0 +1,38 @@
# BUILD IMAGE --------------------------------------------------------
FROM alpine:3.11 AS python-build
# Get build tools and required header files
RUN apk add --no-cache \
python3 python3-dev \
py3-pip py3-virtualenv \
git gcc musl-dev
RUN mkdir /app
WORKDIR /app
ADD . .
ENV VIRTUAL_ENV=/app/venv
RUN python3 -m virtualenv --python=/usr/bin/python3 $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
# Install python dependencies
RUN pip3 install -r requirements.txt
# ACTUAL IMAGE -------------------------------------------------------
FROM alpine:3.11
RUN apk add --no-cache python3
RUN mkdir /app
COPY --from=python-build /app/. /app/
ENV VIRTUAL_ENV=/app/venv
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
LABEL maintainer="jakub@status.im"
LABEL source="https://github.com/status-im/auto-sticker-pinner"
LABEL description="Service for pinning newly added Status Sticker Packs"
ENTRYPOINT ["/app/main.py"]
# By default just show help if called without arguments
CMD ["--help"]