Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 8 additions & 11 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,12 @@ jobs:
PIP_NO_CACHE_DIR: false
PIP_USER: 1

# Hide the graphical elements from pipenv's output
PIPENV_HIDE_EMOJIS: 1
PIPENV_NOSPIN: 1

# Make sure pipenv does not try reuse an environment it's running in
PIPENV_IGNORE_VIRTUALENVS: 1
# Make sure package manager does not use virtualenv
POETRY_VIRTUALENVS_CREATE: false

# Specify explicit paths for python dependencies and the pre-commit
# environment so we know which directories to cache
POETRY_CACHE_DIR: ${{ github.workspace }}/.cache/py-user-base
PYTHONUSERBASE: ${{ github.workspace }}/.cache/py-user-base
PRE_COMMIT_HOME: ${{ github.workspace }}/.cache/pre-commit-cache

Expand All @@ -42,7 +39,7 @@ jobs:
id: python
uses: actions/setup-python@v2
with:
python-version: '3.8'
python-version: '3.9'

# This step caches our Python dependencies. To make sure we
# only restore a cache when the dependencies, the python version,
Expand All @@ -57,14 +54,14 @@ jobs:
path: ${{ env.PYTHONUSERBASE }}
key: "python-0-${{ runner.os }}-${{ env.PYTHONUSERBASE }}-\
${{ steps.python.outputs.python-version }}-\
${{ hashFiles('./Pipfile', './Pipfile.lock') }}"
${{ hashFiles('./pyproject.toml', './poetry.lock') }}"

# Install our dependencies if we did not restore a dependency cache
- name: Install dependencies using pipenv
- name: Install dependencies using poetry
if: steps.python_cache.outputs.cache-hit != 'true'
run: |
pip install pipenv
pipenv install --dev --deploy --system
pip install poetry
poetry install

# This step caches our pre-commit environment. To make sure we
# do create a new environment when our pre-commit setup changes,
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ repos:
hooks:
- id: flake8
name: Flake8
description: This hook runs flake8 within our project's pipenv environment.
entry: pipenv run flake8
description: This hook runs flake8 within our project's environment.
entry: poetry run flake8
language: system
types: [python]
require_serial: true
32 changes: 22 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
FROM tiangolo/uvicorn-gunicorn-fastapi:python3.8-slim
FROM python:3.9.5-slim

# Set pip to have cleaner logs and no saved cache
# Set pip to have no saved cache
ENV PIP_NO_CACHE_DIR=false \
PIPENV_HIDE_EMOJIS=1 \
PIPENV_IGNORE_VIRTUALENVS=1 \
PIPENV_NOSPIN=1 \
POETRY_VIRTUALENVS_CREATE=false \
MODULE_NAME="pixels" \
MAX_WORKERS=10

# Install pipenv
RUN pip install -U pipenv
# Install poetry
RUN pip install -U poetry

# Create the working directory
WORKDIR /pixels

# Install project dependencies
COPY Pipfile* ./
RUN pipenv install --system --deploy
COPY pyproject.toml poetry.lock ./
RUN poetry install --no-dev

# Copy in start script and config
COPY ./start.sh /start.sh
RUN chmod +x /start.sh
COPY ./gunicorn_conf.py /gunicorn_conf.py

# Define Git SHA build argument
ARG git_sha="development"
Expand All @@ -22,4 +28,10 @@ ARG git_sha="development"
ENV GIT_SHA=$git_sha

# Copy the source code in last to optimize rebuilding the image
COPY . /app
COPY . .

EXPOSE 80

# Run the start script, it will check for an /app/prestart.sh script (e.g. for migrations)
# And then will start Gunicorn with Uvicorn
CMD ["/start.sh"]
40 changes: 0 additions & 40 deletions Pipfile

This file was deleted.

Loading