diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..fdd9129 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +.venv +__pycache__ +Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..fb21293 --- /dev/null +++ b/Dockerfile @@ -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"]