From f14dc6c21d9cd8dd6f54468e00d2785d8d403c34 Mon Sep 17 00:00:00 2001 From: LDericher <40151420+ldericher@users.noreply.github.com> Date: Tue, 3 Aug 2021 02:22:00 +0200 Subject: [PATCH] Docker --- .dockerignore | 15 +++++++-------- Dockerfile | 33 +++++++++++++++++++-------------- main.py | 2 ++ 3 files changed, 28 insertions(+), 22 deletions(-) mode change 100644 => 100755 main.py diff --git a/.dockerignore b/.dockerignore index f741930..7f87bd2 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,10 +1,9 @@ -out -__pycache__ -.git +out/ +**/__pycache__/ +.git/ +.idea/ -.gitignore -.dockerignore +/.gitignore +/.dockerignore -Dockerfile -README.md -ffdecks.json +/Dockerfile diff --git a/Dockerfile b/Dockerfile index 94b27b1..80a9656 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,21 +1,26 @@ -FROM python:3.7-alpine +FROM python:3.6-alpine -ENV LIBRARY_PATH=/lib:/usr/lib ENV PYTHONUNBUFFERED 1 -RUN \ - # install build prerequisites \ - apk add --no-cache \ - build-base \ - jpeg-dev \ - zlib-dev \ -&& pip3 install pillow requests \ - # remove build prerequisites \ -&& apk del --no-cache \ - build-base - WORKDIR "/app" +RUN set -ex; \ + pip3 install pipenv; + +COPY Pipfile Pipfile.lock ./ + +RUN set -ex; \ + \ + # install build prerequisites + apk add -t build_reqs --no-cache \ + build-base \ + jpeg-dev \ + zlib-dev \ + ; \ + pipenv sync; \ + # remove build prerequisites + apk del --no-cache build_reqs; + COPY . . -ENTRYPOINT ["./main.py"] +ENTRYPOINT ["pipenv", "run", "./main.py"] diff --git a/main.py b/main.py old mode 100644 new mode 100755 index 578b45e..d158f09 --- a/main.py +++ b/main.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 + import requests from fftcg.opus import Opus