This guide is for running ChordMini with Docker Desktop or Docker Compose.
- Docker Desktop installed and open.
- A copy of this repository on your computer.
- Firebase web app values for the basic app setup.
Note
Docker Desktop must be running before the commands below will work. If Docker is closed, commands such as docker compose up may fail with a message about not being able to connect to the Docker daemon.
../docker-compose.prod.yml- current published Docker Hub images, useful when you download only the production compose file.docker-compose.yml- current published Docker Hub images, used from this repository.docker-compose.dev.yml- builds the frontend and backend images locally from this repository.../Dockerfile- frontend image build.../python_backend/Dockerfile- backend image build.../.env.docker.example- template for Docker environment variables.
From the repository root:
cp .env.docker.example .env.dockerOpen .env.docker and fill in the Firebase values:
NEXT_PUBLIC_FIREBASE_API_KEY=...
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=...
NEXT_PUBLIC_FIREBASE_PROJECT_ID=...
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=...
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=...
NEXT_PUBLIC_FIREBASE_APP_ID=...Optional keys can stay blank until you need those features:
NEXT_PUBLIC_YOUTUBE_API_KEY=
MUSIC_AI_API_KEY=
GEMINI_API_KEY=
GENIUS_API_KEY=Note
Lines that start with NEXT_PUBLIC_ are safe to send to the browser. Keys without NEXT_PUBLIC_, such as GEMINI_API_KEY, are server-only and should not be shared publicly.
This is the shortest path. It pulls the current ptnghia/chordminiapp-frontend:latest and ptnghia/chordminiapp-backend:latest images from Docker Hub.
docker compose -f docker/docker-compose.yml --env-file .env.docker pull
docker compose -f docker/docker-compose.yml --env-file .env.docker upOpen http://localhost:3000.
To stop the app, press Ctrl+C. Then run:
docker compose -f docker/docker-compose.yml --env-file .env.docker downNote
The published images are built for linux/amd64. The compose file includes that platform setting so Docker Desktop can run them on Apple Silicon with emulation. If your computer feels slow with the published images, use Option B to build native local images instead.
Use this option on Intel Macs, Windows PCs, Linux PCs, or whenever pulling the published images fails.
docker compose -f docker/docker-compose.dev.yml --env-file .env.docker build
docker compose -f docker/docker-compose.dev.yml --env-file .env.docker upOpen http://localhost:3000.
To stop the app, press Ctrl+C. Then run:
docker compose -f docker/docker-compose.dev.yml --env-file .env.docker downNote
The first local build can take a while because the backend installs Python audio libraries and downloads model files.
If you prefer to click through Docker Desktop:
- Open Docker Desktop and wait until it says the engine is running.
- Open the repository folder in Terminal, PowerShell, or the Docker Desktop terminal.
- Create
.env.dockerusing Step 1 above. - Run either Option A or Option B above.
- In Docker Desktop, open Containers to see
chordmini-frontend,chordmini-backend, and, for local builds,chordmini-redis. - Use the stop/start buttons in Docker Desktop after the containers have been created.
Note
Avoid running the frontend and backend images one by one from the Images tab. Docker Compose starts them on the same network and passes the app settings from .env.docker, which is the part that makes the services find each other.
Frontend:
curl http://localhost:3000/api/healthBackend:
curl http://localhost:8080/healthBoth should return a small healthy response.
Open Docker Desktop first, wait until it finishes starting, and run the command again.
The app uses these ports:
3000for the web app8080for the Python backend6379for Redis in the local-build setup
Stop the other program using the port, or change the left side of the port mapping in the compose file. For example, 3001:3000 makes the app available at http://localhost:3001.
Use the local-build setup:
docker compose -f docker/docker-compose.dev.yml --env-file .env.docker build
docker compose -f docker/docker-compose.dev.yml --env-file .env.docker upFor the published-image setup:
docker compose -f docker/docker-compose.yml --env-file .env.docker down --volumesFor the local-build setup:
docker compose -f docker/docker-compose.dev.yml --env-file .env.docker down --volumes