Skip to content

Commit

Permalink
Merge pull request #2584 from ujh/fly-web-machines
Browse files Browse the repository at this point in the history
Launch web machines on fly, too
  • Loading branch information
ujh authored Dec 25, 2024
2 parents 7b2f024 + cdb8394 commit a72eb90
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 8 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,9 @@ COPY --from=build "${BUNDLE_PATH}" "${BUNDLE_PATH}"
COPY --from=build /app /app

RUN rm -rf /app/tmp/cache /app/tmp/pids /app/tmp/sockets /app/log
RUN mkdir /app/tmp/pids

EXPOSE 80
EXPOSE 3000

# Entrypoint script always runs, even if command is overwritten
ENTRYPOINT ["/app/config/docker/entrypoint.sh"]
Expand Down
31 changes: 24 additions & 7 deletions fly.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,38 @@ RAILS_MIN_THREADS = "5"
RAILS_SERVE_STATIC_FILES = "enabled"
REDIS_PROVIDER = "REDIS_SIDEKIQ_URL"
SIDEKIQ_CONCURRENCY = "5"
WEB_CONCURRENCY = "4"
WEB_CONCURRENCY = "3"

[processes]
# web = "bundle exec puma"
web = "bundle exec puma"
worker = "bundle exec sidekiq"

[http_service]
internal_port = 3000
processes = ["web"]
force_https = true
auto_stop_machines = "suspend"
auto_start_machines = true
min_machines_running = 1
[http_service.concurrency]
type = "requests"
soft_limit = 20
hard_limit = 40
[[http_service.checks]]
grace_period = "30s"
interval = "30s"
method = "GET"
timeout = "5s"
path = "/"

[[vm]]
memory = '512mb'
cpu_kind = 'shared'
cpus = 1
processes = ["worker"]

# [[vm]]
# memory = '1GB'
# cpu_kind = 'shared'
# cpus = 1
# processes = ["web"]
[[vm]]
memory = '1GB'
cpu_kind = 'shared'
cpus = 4
processes = ["web"]

0 comments on commit a72eb90

Please sign in to comment.