Files
webstudio/.devcontainer/docker-compose.yml
T
Ivan Starkov 2e236917a7 build: Add devcontainer (#3429)
## Description

Allow development in devcontainers, simplifies initial setup

Open project in vscode (and accept open in devcontainer) or in
codespaces, wait setup to complete

run
```
pnpm dev
```

<img width="436" alt="image"
src="https://github.com/webstudio-is/webstudio/assets/5077042/f03fdc99-5c46-4de5-be9c-2bb9420afc99">





## 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.example`
and the `builder/env-check.js` if mandatory
2024-05-28 14:15:55 +03:00

49 lines
1.2 KiB
YAML

version: "3.8"
services:
app:
build:
context: .
dockerfile: Dockerfile
volumes:
- ..:/workspaces/webstudio:cached
# preserve history
- ./.local:/home/node/.local
# 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"]
restart: unless-stopped
volumes:
- postgres-data:/var/lib/postgresql/data
environment:
POSTGRES_PASSWORD: pass
POSTGRES_DB: webstudio
ports:
- ${PGPORT:-5432}:5432
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d webstudio"]
interval: 10s
timeout: 5s
retries: 25
# Add "forwardPorts": ["5432"] to **devcontainer.json** to forward PostgreSQL locally.
# (Adding the "ports" property to this file will not forward from a Codespace.)
volumes:
postgres-data: