diff --git a/docker-compose.yml b/docker-compose.yml --- a/docker-compose.yml +++ b/docker-compose.yml @@ -16,28 +16,11 @@ timeout: 3s retries: 5 - aip: - image: atcr.io/gamesgamesgamesgames.games/aip:2.2.4-dev.1 - ports: - - "8080:8080" - dns: - - 8.8.8.8 - - 8.8.4.4 - environment: - DATABASE_URL: postgres://aip:aip@postgres/aip - STORAGE_BACKEND: postgres - # EXTERNAL_BASE: http://localhost:8080 - DPOP_NONCE_SEED: ${DPOP_NONCE_SEED} - OAUTH_SIGNING_KEYS: ${OAUTH_SIGNING_KEYS} - ATPROTO_OAUTH_SIGNING_KEYS: ${ATPROTO_OAUTH_SIGNING_KEYS} - ENABLE_CLIENT_API: "true" - PORT: 8080 - depends_on: - postgres: - condition: service_healthy - tap: - image: ghcr.io/bluesky-social/indigo/tap:latest + build: + context: ../indigo + dockerfile: cmd/tap/Dockerfile + # image: ghcr.io/bluesky-social/indigo/tap:latest ports: - "2480:2480" environment: @@ -64,7 +47,7 @@ - cargo-target:/app/target environment: DATABASE_URL: postgres://happyview:happyview@postgres/happyview - AIP_URL: http://aip:8080 + AIP_URL: https://aip.gamesgamesgamesgames.games TAP_URL: http://tap:2480 TAP_ADMIN_PASSWORD: ${TAP_ADMIN_PASSWORD} RELAY_URL: https://relay1.us-east.bsky.network @@ -72,8 +55,6 @@ depends_on: postgres: condition: service_healthy - aip: - condition: service_started tap: condition: service_started @@ -89,7 +70,7 @@ environment: HOSTNAME: 0.0.0.0 API_URL: http://happyview:3000 - AIP_PROXY_URL: http://aip:8080 + AIP_PROXY_URL: https://aip.gamesgamesgamesgames.games # NEXT_PUBLIC_AIP_URL: http://localhost:8080 volumes: diff --git a/docker/Dockerfile.postgres b/docker/Dockerfile.postgres new file mode 100644 --- /dev/null +++ b/docker/Dockerfile.postgres @@ -0,0 +1,2 @@ +FROM ghcr.io/railwayapp-templates/postgres-ssl:17 +COPY init-databases.sh /docker-entrypoint-initdb.d/ diff --git a/docker/init-databases.sh b/docker/init-databases.sh --- a/docker/init-databases.sh +++ b/docker/init-databases.sh @@ -2,8 +2,7 @@ set -e psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL - CREATE USER aip WITH PASSWORD 'aip'; - CREATE DATABASE aip OWNER aip; - CREATE USER tap WITH PASSWORD 'tap'; - CREATE DATABASE tap OWNER tap; + CREATE DATABASE aip; + CREATE DATABASE happyview; + CREATE DATABASE tap; EOSQL diff --git a/.github/workflows/docker-postgres.yml b/.github/workflows/docker-postgres.yml new file mode 100644 --- /dev/null +++ b/.github/workflows/docker-postgres.yml @@ -0,0 +1,41 @@ +name: Build and Publish Postgres Image + +on: + push: + branches: [main, dev] + paths: + - docker/Dockerfile.postgres + - docker/init-databases.sh + +env: + GHCR_POSTGRES_IMAGE: ghcr.io/${{ github.repository }}-postgres + +jobs: + postgres: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: docker + file: docker/Dockerfile.postgres + push: true + tags: ${{ env.GHCR_POSTGRES_IMAGE }}:latest + cache-from: type=gha,scope=postgres + cache-to: type=gha,scope=postgres,mode=max diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -9,7 +9,7 @@ ATCR_IMAGE: atcr.io/${{ secrets.ATCR_NAMESPACE }}/happyview jobs: - build: + happyview: runs-on: ubuntu-latest permissions: contents: read