A lexicon-driven AppView for ATProto. happyview.dev
backfill firehose jetstream atproto appview oauth lexicon
8
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: add Dockerfile, docker-compose, and CI workflow

Trezy 443f0df0 c9c57d69

+156
+7
.dockerignore
··· 1 + target/ 2 + tests/ 3 + .git/ 4 + .github/ 5 + .claude/ 6 + .env 7 + docker-compose*.yml
+61
.github/workflows/docker.yml
··· 1 + name: Build and Publish Docker Image 2 + 3 + on: 4 + push: 5 + branches: [main] 6 + tags: ["v*"] 7 + 8 + env: 9 + IMAGE_NAME: happyview 10 + 11 + jobs: 12 + build: 13 + runs-on: ubuntu-latest 14 + permissions: 15 + contents: read 16 + packages: write 17 + 18 + steps: 19 + - uses: actions/checkout@v4 20 + 21 + - uses: docker/setup-qemu-action@v3 22 + 23 + - uses: docker/setup-buildx-action@v3 24 + 25 + - name: Log in to ghcr.io 26 + uses: docker/login-action@v3 27 + with: 28 + registry: ghcr.io 29 + username: ${{ github.actor }} 30 + password: ${{ secrets.GITHUB_TOKEN }} 31 + 32 + - name: Log in to atcr 33 + if: vars.ATCR_REGISTRY != '' 34 + uses: docker/login-action@v3 35 + with: 36 + registry: ${{ vars.ATCR_REGISTRY }} 37 + username: ${{ secrets.ATCR_USERNAME }} 38 + password: ${{ secrets.ATCR_PASSWORD }} 39 + 40 + - name: Generate image metadata 41 + id: meta 42 + uses: docker/metadata-action@v5 43 + with: 44 + images: | 45 + ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }} 46 + ${{ vars.ATCR_REGISTRY && format('{0}/{1}', vars.ATCR_REGISTRY, env.IMAGE_NAME) || '' }} 47 + tags: | 48 + type=raw,value=latest,enable={{is_default_branch}} 49 + type=semver,pattern={{version}} 50 + type=sha,prefix= 51 + 52 + - name: Build and push 53 + uses: docker/build-push-action@v6 54 + with: 55 + context: . 56 + platforms: linux/amd64,linux/arm64 57 + push: true 58 + tags: ${{ steps.meta.outputs.tags }} 59 + labels: ${{ steps.meta.outputs.labels }} 60 + cache-from: type=gha 61 + cache-to: type=gha,mode=max
+26
Dockerfile
··· 1 + FROM rust:1.93 AS builder 2 + 3 + WORKDIR /app 4 + 5 + COPY Cargo.toml Cargo.lock ./ 6 + COPY src/ src/ 7 + COPY migrations/ migrations/ 8 + 9 + ENV SQLX_OFFLINE=true 10 + RUN cargo build --release 11 + 12 + FROM debian:bookworm-slim 13 + 14 + RUN apt-get update && apt-get install -y --no-install-recommends \ 15 + ca-certificates \ 16 + && rm -rf /var/lib/apt/lists/* 17 + 18 + RUN useradd -r -s /bin/false happyview 19 + 20 + COPY --from=builder /app/target/release/happyview /usr/local/bin/happyview 21 + 22 + USER happyview 23 + 24 + EXPOSE 3000 25 + 26 + ENTRYPOINT ["happyview"]
+62
docker-compose.yml
··· 1 + services: 2 + postgres: 3 + image: postgres:17 4 + environment: 5 + POSTGRES_USER: happyview 6 + POSTGRES_PASSWORD: happyview 7 + POSTGRES_DB: happyview 8 + ports: 9 + - "5432:5432" 10 + volumes: 11 + - pgdata:/var/lib/postgresql/data 12 + healthcheck: 13 + test: ["CMD-SHELL", "pg_isready -U happyview"] 14 + interval: 5s 15 + timeout: 3s 16 + retries: 5 17 + 18 + aip-postgres: 19 + image: postgres:17 20 + environment: 21 + POSTGRES_USER: aip 22 + POSTGRES_PASSWORD: aip 23 + POSTGRES_DB: aip 24 + volumes: 25 + - aip-pgdata:/var/lib/postgresql/data 26 + healthcheck: 27 + test: ["CMD-SHELL", "pg_isready -U aip"] 28 + interval: 5s 29 + timeout: 3s 30 + retries: 5 31 + 32 + aip: 33 + image: atcr.io/gamesgamesgamesgames.games/aip:latest 34 + ports: 35 + - "8080:8080" 36 + environment: 37 + DATABASE_URL: postgres://aip:aip@aip-postgres/aip 38 + STORAGE_BACKEND: postgres 39 + EXTERNAL_BASE: http://localhost:8080 40 + DPOP_NONCE_SEED: ${DPOP_NONCE_SEED} 41 + HTTP_PORT: 8080 42 + depends_on: 43 + aip-postgres: 44 + condition: service_healthy 45 + 46 + happyview: 47 + build: . 48 + ports: 49 + - "3000:3000" 50 + environment: 51 + DATABASE_URL: postgres://happyview:happyview@postgres/happyview 52 + AIP_URL: http://aip:8080 53 + ADMIN_SECRET: ${ADMIN_SECRET:-dev-secret} 54 + depends_on: 55 + postgres: 56 + condition: service_healthy 57 + aip: 58 + condition: service_started 59 + 60 + volumes: 61 + pgdata: 62 + aip-pgdata: