Skip to content
This repository has been archived by the owner on Sep 25, 2023. It is now read-only.

Commit

Permalink
Remove heroku
Browse files Browse the repository at this point in the history
  • Loading branch information
Saphyel committed Mar 6, 2023
1 parent 649b7b0 commit 29db97b
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 1,449 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ jobs:
run: docker build -t local .
- name: Install dev tools
run: |
docker run --name app local pdm install
docker run --name app local pip install .[dev]
docker commit app app
- name: Check code style
run: docker run app python -m black --check .
run: docker run app black --check .
# - name: Check static types
# run: docker run app python -m mypy .
# run: docker run app mypy .
- name: Test with pytest
run: docker run -e DATABASE_URL app pdm run test -m "not webtest"
run: docker run -e DATABASE_URL app coverage run -m pytest tests/ --junitxml=junit.xml -m "not webtest"
15 changes: 11 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
FROM saphyel/python:pdm
FROM python:3.11-slim

ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1

ENV PIP_DISABLE_PIP_VERSION_CHECK=1
ENV PIP_NO_CACHE_DIR=1
ENV PIP_ROOT_USER_ACTION=ignore

ENV PORT 80
EXPOSE $PORT
WORKDIR /app

COPY pdm.lock pyproject.toml /app/
RUN pdm install --prod
COPY pyproject.toml /app/
RUN pip install .

COPY . /app

CMD python -m uvicorn main:app --host 0.0.0.0 --port $PORT
CMD uvicorn main:app --host 0.0.0.0 --port $PORT
16 changes: 15 additions & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
ports: [ "8081:80" ]
volumes:
- ./:/app/
command: pdm run server
command: uvicorn main:app --host 0.0.0.0 --port $PORT --reload
env_file: [ .env ]

db:
Expand All @@ -18,5 +18,19 @@ services:
POSTGRES_PASSWORD: password
links: [ webapp ]

# locust:
# image: locustio/locust
# ports: [ "8089:8089" ]
# volumes:
# - ./:/mnt/locust
# command: -f /mnt/locust/locustfile.py --master -H http://webapp:80
#
# locust_worker:
# image: locustio/locust
# volumes:
# - ./:/mnt/locust
# command: -f /mnt/locust/locustfile.py --worker --master-host locust
# links: [ locust ]

volumes:
pgdata:
10 changes: 0 additions & 10 deletions heroku.yml

This file was deleted.

Loading

0 comments on commit 29db97b

Please sign in to comment.