This app scaffold is generated by orats.
-
Activate docker swarm mode
docker swarm init
-
Build and run the project with Docker Compose
docker-compose up --build
-
Reset and Migrate the database (run this in a 2nd Docker-enabled terminal)
docker-compose exec website rails db:reset docker-compose exec website rails db:migrate
Linux users have to set the user flag:
docker-compose exec --user "$(id -u):$(id -g)" website rails db:reset docker-compose exec --user "$(id -u):$(id -g)" website rails db:migrate -
Visit
http://localhost:3000
-
Start the whole app
docker-compose up -
Development as usual
Make code changes. Reload page.
If you have to run any tasks inside the container use
docker-compose exec <service-name> <cmd>:docker-compose exec website rails db:migrateTo open a console in a container:
docker-compose exec website sh -
Stop all services
- Variant a: run in a separate terminal window (same directory) to clean up all:
docker-compose up - Variant b: press
Ctrl+Cin the running terminal (containers are not removed)
- Variant a: run in a separate terminal window (same directory) to clean up all:
docker stack deploy shop -c docker-compose.yml-
docker volume create portainer_data -
start portainer
-
As a single container:
docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer
-
As a docker swarm service (prefered)
docker service create \ --name portainer \ -p 9000:9000 \ --constraint 'node.role == manager' \ --mount type=bind,src=/var/run/docker.sock,dst=/var/run/docker.sock \ --mount type=volume,src=portainer_data,dst=/data \ portainer/portainer -H unix:///var/run/docker.sock
-
- If you get an rack time-out error, set the env var
RACK_REQUEST_TIMEOUTto20in.env. It's caused by the assets compiling running for the first time.