Skip to content

Using Docker Compose

Alex Musayev edited this page Jun 19, 2023 · 6 revisions

Starting from a clean slate

Stop the containers:

docker-compose down --remove-orphans

Delete all containers:

docker rm -f $(docker ps -a -q)

Delete all volumes:

docker volume rm $(docker volume ls -q)

Restart the containers:

docker-compose up

Exposing ports

⚠️ docker-compose run does NOT expose ports by design. Use docker-compose up app to run Puma.

docker-compose.yml:

ports:
 - "EXTERNAL_PORT:INTERNAL_PORT"

INTERNAL_PORT - same as Dockerfile exposes.

Dockerfile:

EXPOSE 3000
Clone this wiki locally