Skip to content

Commit

Permalink
Add bin/deploy to document and automate process
Browse files Browse the repository at this point in the history
  • Loading branch information
parndt committed Jul 3, 2024
1 parent 83c2fce commit 2717d79
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
9 changes: 2 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from ruby:3.3.3-alpine
FROM ruby:3.3.3-alpine

# apk dependencies:
# sassc: g++
Expand All @@ -25,12 +25,7 @@ RUN if [ "$RAILS_ENV" = "production" ]; then \
&& bundle install \
&& yarn install \
&& bundle exec rake assets:precompile \
&& rm -f /swapfile \
&& dd if=/dev/zero of=/swapfile bs=1024 count=1048576 \
&& mkswap /swapfile \
&& chmod 600 /swapfile; \
fi

EXPOSE ${PORT:-3000}
CMD if [ -f /swapfile ]; then swapon /swapfile; fi; \
bundle exec falcon serve -n "${FALCON_INSTANCES:-1}" -b "http://0.0.0.0:${PORT:-3000}"
CMD bundle exec falcon serve -n "${FALCON_INSTANCES:-1}" -b "http://0.0.0.0:${PORT:-3000}"
8 changes: 8 additions & 0 deletions bin/deploy
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

fly deploy
fly ssh console --command 'fallocate -l 512M /swapfile'
fly ssh console --command 'chmod 0600 /swapfile'
fly ssh console --command 'mkswap /swapfile'
fly ssh console --command 'sysctl -w vm.swappiness=10'
fly ssh console --command 'swapon /swapfile'

0 comments on commit 2717d79

Please sign in to comment.