This guide uses Docker Compose to run Strapi in containers.
For Docker installation, see Docker.
cat <<'YAML' > docker-compose.yml
services:
db:
image: postgres:15
restart: unless-stopped
environment:
POSTGRES_DB: cms
POSTGRES_USER: cms
POSTGRES_PASSWORD: change-me
app:
image: node:18
restart: unless-stopped
depends_on:
- db
ports:
- "8080:8080"
working_dir: /app
volumes:
- ./app:/app
command: "npm start"
YAML
docker compose up -d
Open http://YOUR-SERVER:8080 and complete the setup.
Running containers in production? We help with:
Need help? office@linux-server-admin.com or Contact Us