Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

2.2 KB
Raw Blame
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
      - ${HOME}/.github/instructions:/home/node/.github/instructions

    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: