graphql Docker & Self-Hosted Deployment

GitHub

TypeScript apollo & jamstack repository by @redwoodjs. AI agent rules & system prompts with 18k stars.

17,610 stars TypeScript TypeScript 1 file ยท ~11,988 tokens #apollo#graphql#jamstack#prisma#react
RAW Compose
1. Pull Image (DOCKERHUB) docker pull library/postgres
2. Docker Run (1-Click Launch) docker run -d --name graphql -p 8910:8910 --restart always postgres:16-bookworm
3. Podman Run podman run -d --name graphql -p 8910:8910 --restart always postgres:16-bookworm
4. Skopeo Inspect (Zero-Pull Manifest) skopeo inspect docker://docker.io/library/postgres:16-bookworm
5. ORAS Pull (OCI Artifact) oras pull postgres:16-bookworm
6. Compose Deployment docker compose up -d
packages/cli/src/commands/setup/docker/templates/docker-compose.dev.yml
Download .yml
services:
  redwood:
    build:
      context: .
      dockerfile: ./Dockerfile
      target: base
    command: yarn rw dev
    volumes:
      - .:/home/node/app
      - node_modules:/home/node/app/node_modules
    ports:
      - '8910:8910'
    depends_on:
      - db
    environment:
      - DATABASE_URL=postgresql://redwood:redwood@db:5432/redwood
      - TEST_DATABASE_URL=postgresql://redwood:redwood@db:5432/redwood_test
      - SESSION_SECRET=super_secret_session_key_change_me_in_production_please
      - CI=
      - NODE_ENV=development
      - REDWOOD_API_HOST=0.0.0.0

  db:
    image: postgres:16-bookworm
    environment:
      POSTGRES_USER: redwood
      POSTGRES_PASSWORD: redwood
      POSTGRES_DB: redwood
    ports:
      - '5432:5432'
    volumes:
      - postgres:/var/lib/postgresql/data

  # After starting with `docker compose -f ./docker-compose.dev.yml up`,
  # use the console to run commands in the container:
  #
  # ```
  # docker compose -f ./docker-compose.dev.yml run --rm -it console /bin/bash
  # root@...:/home/node/app# yarn rw prisma migrate dev
  # ```
  console:
    user: root
    build:
      context: .
      dockerfile: ./Dockerfile
      target: console
    tmpfs:
      - /tmp
    command: 'true'
    environment:
      - DATABASE_URL=postgresql://redwood:redwood@db:5432/redwood
      - TEST_DATABASE_URL=postgresql://redwood:redwood@db:5432/redwood_test
    depends_on:
      - db

volumes:
  node_modules:
  postgres: