Steps to reproduce:
- Create a new rails app
echo 'gem install rails && rails new . --skip-webpack-install --database=postgresql' | docker run -i --rm -v $PWD:/app -w /app ruby sh
- Whitelist
*.local.on-acorn.io
inconfig.ru
Rails.application.configure do
config.hosts << "*.local.on-acorn.io"
end
- Enable environment variables for Postgres in
config/database.yml
default: &default
#...
# add these
host: <%= ENV.fetch("DATABASE_HOST") { "db" } %>
database: <%= ENV.fetch("DATABASE_NAME") { "rails-example" } %>
username: <%= ENV.fetch("DATABASE_USERNAME") { "rails-example" } %>
password: <%= ENV.fetch("DATABASE_PASSWORD") { "rails-example" } %>
#...
test:
<<: *default
# remove existing
#...
production:
<<: *default
# remove existing
-
Add Acornfile, Dockerfile and entrypoint.sh
-
Ensure you can connect to your Docker Desktop with kubectl
-
Run
acorn install
-
Run
acorn run .
oracorn run -i .
for development mode -
Add the
*.local.on-acorn.io
domain to your/etc/hosts
file. For example:
127.0.0.1 server-holy-water-ab5e9d1e.local.on-acorn.io