diff options
-rw-r--r-- | Dockerfile | 33 | ||||
-rw-r--r-- | Pipfile | 4 | ||||
-rw-r--r-- | azure-pipelines.yml | 8 | ||||
-rw-r--r-- | docker/ci.Dockerfile | 20 |
4 files changed, 14 insertions, 51 deletions
diff --git a/Dockerfile b/Dockerfile index aa6333380..21a938c4f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,27 +1,20 @@ -FROM python:3.7-alpine3.7 +FROM python:3.7-slim -RUN apk add --no-cache \ - build-base \ - freetype-dev \ - git \ - jpeg-dev \ - libffi-dev \ - libxml2 \ - libxml2-dev \ - libxslt-dev \ - tini \ - zlib \ - zlib-dev - -ENV \ - LIBRARY_PATH=/lib:/usr/lib +# Set pip to have cleaner logs and no saved cache +ENV PIP_NO_CACHE_DIR=false \ + PIPENV_HIDE_EMOJIS=1 \ + PIPENV_IGNORE_VIRTUALENVS=1 \ + PIPENV_NOSPIN=1 +# Install pipenv RUN pip install -U pipenv +# Copy project files into working directory WORKDIR /bot -COPY . . +COPY docker . -RUN pipenv install --deploy --system +# Install project dependencies +RUN pipenv install --system --deploy -ENTRYPOINT ["/sbin/tini", "--"] -CMD ["python3", "-m", "bot"] +ENTRYPOINT ["python3"] +CMD ["-m", "bot"] @@ -42,7 +42,5 @@ python_version = "3.7" start = "python -m bot" lint = "python -m flake8" precommit = "pre-commit install" -build = "docker build -t pythondiscord/bot:latest -f docker/bot.Dockerfile ." +build = "docker build -t pythondiscord/bot:latest -f Dockerfile ." push = "docker push pythondiscord/bot:latest" -buildbase = "docker build -t pythondiscord/bot-base:latest -f docker/base.Dockerfile ." -pushbase = "docker push pythondiscord/bot-base:latest" diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 0c47d2544..1adbd12ea 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -8,21 +8,13 @@ variables: jobs: - job: test displayName: 'Lint & Test' - pool: vmImage: ubuntu-16.04 variables: - PIPENV_CACHE_DIR: ".cache/pipenv" PIP_CACHE_DIR: ".cache/pip" - PIP_SRC: ".cache/src" steps: - - script: | - sudo apt-get update - sudo apt-get install build-essential curl docker libffi-dev libfreetype6-dev libxml2 libxml2-dev libxslt1-dev zlib1g zlib1g-dev - displayName: 'Install base dependencies' - - task: UsePythonVersion@0 displayName: 'Set Python version' inputs: diff --git a/docker/ci.Dockerfile b/docker/ci.Dockerfile deleted file mode 100644 index fd7e25239..000000000 --- a/docker/ci.Dockerfile +++ /dev/null @@ -1,20 +0,0 @@ -FROM python:3.6-alpine3.7 - -RUN apk add --update docker \ - curl \ - tini \ - build-base \ - libffi-dev \ - zlib \ - jpeg-dev \ - libxml2 libxml2-dev libxslt-dev \ - zlib-dev \ - freetype-dev - -RUN pip install pipenv - -ENV LIBRARY_PATH=/lib:/usr/lib -ENV PIPENV_VENV_IN_PROJECT=1 -ENV PIPENV_IGNORE_VIRTUALENVS=1 -ENV PIPENV_NOSPIN=1 -ENV PIPENV_HIDE_EMOJIS=1 |