Skip to content

Commit 808c15c

Browse files
committed
fly deployment
1 parent 7817fb2 commit 808c15c

File tree

5 files changed

+56
-2
lines changed

5 files changed

+56
-2
lines changed

.dockerignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ dist
2121
.pytest_cache
2222

2323
html/*
24-
24+
fly.toml
2525
__pycache__

.github/workflows/fly.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# See https://fly.io/docs/app-guides/continuous-deployment-with-github-actions/
2+
3+
name: Norebase challenge API Fly Deployment
4+
on:
5+
push:
6+
branches:
7+
- main
8+
jobs:
9+
deploy:
10+
name: Deploy app
11+
runs-on: ubuntu-latest
12+
concurrency: deploy-group # optional: ensure only one action runs at a time
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: superfly/flyctl-actions/setup-flyctl@master
16+
- run: flyctl deploy --remote-only
17+
env:
18+
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}

Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM python:3.12.7 AS builder
2+
3+
ENV PYTHONUNBUFFERED=1 \
4+
PYTHONDONTWRITEBYTECODE=1
5+
WORKDIR /app
6+
7+
8+
RUN python -m venv .venv
9+
COPY requirements.txt ./
10+
RUN .venv/bin/pip install -r requirements.txt
11+
FROM python:3.12.7-slim
12+
WORKDIR /app
13+
COPY --from=builder /app/.venv .venv/
14+
COPY . .
15+
CMD alembic upgrade heads && /app/.venv/bin/fastapi run

fly.toml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# fly.toml app configuration file generated for norebase-challenge on 2024-11-02T20:31:20+01:00
2+
#
3+
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
4+
#
5+
6+
app = 'norebase-challenge'
7+
primary_region = 'ams'
8+
9+
[build]
10+
11+
[http_service]
12+
internal_port = 8000
13+
force_https = true
14+
auto_stop_machines = 'stop'
15+
auto_start_machines = true
16+
min_machines_running = 0
17+
processes = ['app']
18+
19+
[[vm]]
20+
memory = '1gb'
21+
cpu_kind = 'shared'
22+
cpus = 1

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
alembic==1.13.3
22
annotated-types==0.7.0
33
anyio==4.6.2.post1
4-
bcrypt==4.2.0
54
certifi==2024.8.30
65
click==8.1.7
76
dnspython==2.7.0

0 commit comments

Comments
 (0)