Skip to content

How to use local sqlite database? #596

Answered by sedubois
sedubois asked this question in Q&A
Discussion options

You must be logged in to vote

address already in use was because nginx was already running on the server and blocking port 80.

For anyone interested, the setup below allowed me to deploy a Rails app with SQLite to a single server. The volumes part is to persist the DB between deploys.

config/deploy.yml:

service: ...
image: ...
servers:
  - <ip address>
registry:
  username: ...
  password:
    - KAMAL_REGISTRY_PASSWORD
volumes:
  - "storage:/rails/storage"
env:
  secret:
    - RAILS_MASTER_KEY

config/database.yml (default - left untouched):

default: &default
  adapter: sqlite3
  pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
  timeout: 5000

production:
  <<: *default
  database: storage/production.sqlite3

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by sedubois
Comment options

You must be logged in to vote
1 reply
@cmoel
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants