Skip to content

Commit

Permalink
Deploys to fly.io
Browse files Browse the repository at this point in the history
  • Loading branch information
cuducos committed Oct 5, 2024
1 parent 346c0ef commit 16e32e6
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 7 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Deploy
on:
push:
branches:
- main
jobs:
deploy:
name: Deploy app
runs-on: ubuntu-latest
concurrency: deploy-group
steps:
- uses: actions/checkout@v4
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: flyctl deploy --remote-only
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
18 changes: 11 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
FROM python:3.11-slim
FROM python:3.11-slim-bookworm AS builder
ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1
WORKDIR /app
RUN pip install poetry && useradd -m keller
USER keller
COPY pyproject.toml .
COPY poetry.lock .
COPY triathlon_live_calendar/ .
RUN pip install poetry && poetry config virtualenvs.in-project true
COPY pyproject.toml poetry.lock ./
RUN poetry install
CMD ["poetry", "run", "python", "-m", "triathlon_live_calendar", "web"]

FROM python:3.11-slim
WORKDIR /app
COPY --from=builder /app/.venv .venv/
COPY /triathlon_live_calendar ./triathlon_live_calendar
CMD ["/app/.venv/bin/python", "-m", "triathlon_live_calendar", "web"]
20 changes: 20 additions & 0 deletions fly.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# fly.toml app configuration file generated for triathlon-live-calendar on 2024-10-05T18:57:12-04:00
#
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#

app = 'triathlon-live-calendar'
primary_region = 'yul'

[build]

[http_service]
internal_port = 8000
force_https = true
auto_stop_machines = 'stop'
auto_start_machines = true
min_machines_running = 0
processes = ['app']

[[vm]]
size = 'shared-cpu-1x'

0 comments on commit 16e32e6

Please sign in to comment.