Files
webstudio/.devcontainer/docker-compose.yml
T
Ivan Starkov 8d51926dc5 chore: Add Docker-in-Docker Support for Utilities like Supabase CLI (#3785)
## Description

1. What is this PR about (link the issue and add a short description)

## Steps for reproduction

1. click button
2. expect xyz

## Code Review

- [ ] hi @kof, I need you to do
  - conceptual review (architecture, feature-correctness)
  - detailed review (read every line)
  - test it on preview

## Before requesting a review

- [ ] made a self-review
- [ ] added inline comments where things may be not obvious (the "why",
not "what")

## Before merging

- [ ] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file
2024-07-25 20:50:52 +03:00

72 lines
2.1 KiB
YAML

version: "3.8"
services:
app:
init: true
privileged: true
build:
context: .
dockerfile: Dockerfile
volumes:
- ..:/workspaces/webstudio:cached
# preserve history
- ./.local:/home/node/.local
- docker-data:/var/lib/docker
entrypoint: ["/usr/local/share/docker-init.sh"]
# Overrides default command so things don't shut down after the process ends.
command: sleep infinity
# Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function.
network_mode: service:db
depends_on:
db:
condition: service_healthy
db:
image: ghcr.io/supabase/postgres:15.1.1.55
# Uncomment to log all queries
command: ["postgres", "-c", "log_statement=all", "-c", "listen_addresses=*"]
restart: unless-stopped
volumes:
- postgres-data:/var/lib/postgresql/data
environment:
POSTGRES_PASSWORD: pass
POSTGRES_DB: webstudio
ports:
- ${PGPORT:-5432}:5432
- 3000:3000
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d webstudio"]
interval: 10s
timeout: 5s
retries: 25
rest:
container_name: supabase-rest
image: postgrest/postgrest:v12.2.0
depends_on:
db:
# Disable this if you are using an external Postgres database
condition: service_healthy
restart: unless-stopped
environment:
PGRST_DB_URI: postgresql://postgres:pass@localhost/webstudio
PGRST_DB_SCHEMAS: ${PGRST_DB_SCHEMAS:-public}
PGRST_DB_ANON_ROLE: anon
PGRST_JWT_SECRET: ${JWT_SECRET:-jwtsecretjwtsecretjwtsecretjwtsecretjwtsecretjwtsecretjwtsecretjwtsecretjwtsecretjwtsecretjwtsecretjwtsecret}
PGRST_DB_USE_LEGACY_GUCS: "false"
PGRST_APP_SETTINGS_JWT_SECRET: ${JWT_SECRET:-jwtsecretjwtsecretjwtsecretjwtsecretjwtsecretjwtsecretjwtsecretjwtsecretjwtsecretjwtsecretjwtsecretjwtsecret}
PGRST_APP_SETTINGS_JWT_EXP: ${JWT_EXPIRY}
command: "postgrest"
# Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function.
network_mode: service:db
volumes:
postgres-data:
docker-data: