Skip to content

Commit

Permalink
Fly config
Browse files Browse the repository at this point in the history
  • Loading branch information
janbaykara committed Nov 24, 2023
1 parent 1e93cfa commit d3093d6
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 17 deletions.
6 changes: 5 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM nikolaik/python-nodejs:python3.9-nodejs18-bullseye
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
WORKDIR /app

# OS deps
Expand Down Expand Up @@ -36,4 +38,6 @@ RUN NODE_ENV=production yarn vite build
# Rerun collect static to include the built files
RUN SECRET_KEY=dummy poetry run python manage.py collectstatic --noinput --clear

CMD ["bash", "-c", "poetry run gunicorn --threads=2 -b 0.0.0.0:${PORT:-80} app.wsgi"]
EXPOSE 8080

CMD ["bash", "-c", "poetry", "run", "gunicorn", "--bind", ":8080", "--workers", "2", "app.wsgi"]
45 changes: 29 additions & 16 deletions fly.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# fly.toml app configuration file generated for lbc-staging on 2023-10-17T13:13:20+01:00
# fly.toml app configuration file generated for lbc-staging-2 on 2023-11-24T23:14:47Z
#
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#

app = "lbc-staging"
app = "lbc-staging-2"
primary_region = "lhr"
kill_signal = "SIGTERM"
primary_region = "ams"
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 1
console_command = "poetry run python manage.py shell"

[build]

[deploy]
release_command = "make release"
Expand All @@ -17,30 +17,43 @@ min_machines_running = 1
[env]
PORT = "8080"

[[services]]
[http_service]
internal_port = 8080
force_https = true
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 0
processes = ["app"]

[[services]]
protocol = "tcp"
[services.concurrency]
hard_limit = 25
soft_limit = 20
type = "connections"
internal_port = 8080

[[services.ports]]
handlers = ["http"]
port = 80
handlers = ["http"]

[[services.ports]]
handlers = ["tls", "http"]
port = 443
handlers = ["tls", "http"]
[services.concurrency]
type = "connections"
hard_limit = 25
soft_limit = 20

[[services.http_checks]]
interval = "10s"
timeout = "2s"
grace_period = "5s"
interval = 10000
method = "get"
path = "/"
protocol = "http"
timeout = 2000

[[vm]]
cpu_kind = "shared"
cpus = 1
memory_mb = 1024

[[statics]]
guest_path = "/app/static"
url_prefix = "/static"
url_prefix = "/static/"

0 comments on commit d3093d6

Please sign in to comment.