Skip to content

Installation

PetHealth is a single container: the API and the web UI run together on port 3001 inside the container, and all data lives in /app/data.

  • Docker Engine 20+ (or Docker Desktop), plus Docker Compose v2 if you use Compose.
  • About 200 MB of disk for the image, plus whatever your uploads take.
  • The image is linux/amd64. For ARM, see Build from source.

Create a folder and add two files.

docker-compose.yml

services:
pethealth:
image: martitoci/pethealth:latest
container_name: pethealth
restart: unless-stopped
ports:
- "3000:3001"
volumes:
- ./data:/app/data
env_file: .env

.env

Terminal window
echo "JWT_SECRET=$(openssl rand -hex 32)" > .env
echo "TZ=America/New_York" >> .env

Then start it:

Terminal window
docker compose up -d
docker compose logs -f # optional: watch the first start

On the first start the log shows lines like these (migrations, the default user, the demo pets):

🔄 Migración 5 aplicada
⚠️ Usuario por defecto creado: admin / admin123 — se pedirá cambiarla al entrar
🐾 Mascotas de demostración creadas: Milo, Luna, Copito, Rocky
🚀 Backend corriendo en puerto 3001

(Server logs are in Spanish.) See Environment variables for everything you can put in .env.

Terminal window
docker run -d --name pethealth --restart unless-stopped \
-p 3000:3001 \
-e JWT_SECRET="$(openssl rand -hex 32)" \
-e TZ=America/New_York \
-v "$(pwd)/data:/app/data" \
martitoci/pethealth:latest

Add more -e NAME=value flags for other settings.

Use this on ARM machines or if you want to change the code.

Terminal window
git clone https://github.com/chmedinap/pethealth.git
cd pethealth
cp .env.example .env # then set JWT_SECRET (openssl rand -hex 32)
docker compose up --build -d

The repository’s docker-compose.yml builds the image locally and passes every supported variable from .env.

Set SEED_DEMO=false before the first start. Demo pets are only created when the database is new, so changing it later has no effect. Delete the demo pets from their profile instead.

Terminal window
docker compose pull
docker compose up -d

Database migrations run automatically on startup. Read the release notes before updating, and keep a backup of data/.

Terminal window
docker compose down # stop and remove the container
rm -rf data # ⚠️ deletes all your pets' data