Skip to content

Conversation

@linuskang
Copy link
Contributor

This pull request introduces comprehensive improvements for Docker-based deployment, environment configuration, and CI/CD automation. It adds Docker support with production-ready configuration, provides example environment variables, implements automated GitHub workflows for PR labeling and Docker builds, and enhances documentation for self-hosting. These changes streamline deployment, improve developer experience, and enforce best practices for environment and code management.

Overall platform enhancements

Docker and Deployment Enhancements:

  • Added a production-ready Dockerfile with multi-stage builds for efficient, secure, and reproducible Docker images.
  • Introduced a .dockerignore file to exclude unnecessary files from Docker build context, reducing image size and build time.
  • Added a docker-compose.yml file for easy local orchestration and configuration of environment variables.

Environment and Configuration Management:

  • Provided a comprehensive .env.example file listing all required environment variables for authentication, database, S3 storage, API, and logging.

CI/CD and Automation:

  • Added GitHub Actions workflow for Docker image build, push to GitHub Container Registry, and image vulnerability scanning (.github/workflows/deploy-docker.yml).
  • Implemented PR automation workflow for auto-labeling, size labeling, welcome messages for first-time contributors, and PR title checks (.github/workflows/prs.yml).
  • Introduced .github/labler.yml to configure labeler actions based on file changes, enabling better PR categorization.

Documentation Improvements:

  • Updated README.md with clearer instructions for self-hosting, access URL, and links to official documentation. [1] [2]

Build and Dependency Updates:

  • Added sharp as a new dependency in package.json for image processing.
  • Updated Prisma client generator in prisma/schema.prisma to support additional binary targets for compatibility in Docker environments.

Copilot AI review requested due to automatic review settings December 20, 2025 09:29
@github-project-automation github-project-automation bot moved this to Backlog in Bubbly Maps Dec 20, 2025
@github-actions github-actions bot added documentation Improvements or additions to documentation dependencies Pull requests that update a dependency file ci/cd configuration database docker labels Dec 20, 2025
@linuskang linuskang self-assigned this Dec 20, 2025
@linuskang
Copy link
Contributor Author

@copilot Please run ci/cd checks on the v5 branch to ensure stable.

Copy link

Copilot AI commented Dec 20, 2025

@linuskang I've opened a new pull request, #20, to work on those changes. Once the pull request is ready, I'll request review from you.

@linuskang linuskang merged commit 54cd40e into stable Dec 20, 2025
16 checks passed
@github-project-automation github-project-automation bot moved this from Backlog to Done in Bubbly Maps Dec 20, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request merges v5.0.0 into stable, introducing comprehensive Docker-based deployment infrastructure, CI/CD automation, and improved configuration management for self-hosting the Bubbly Maps application.

Key Changes:

  • Production-ready Docker configuration with multi-stage builds and standalone Next.js output
  • GitHub Actions workflows for PR automation (labeling, size checking, welcome messages) and Docker image builds
  • Environment configuration examples and documentation improvements for self-hosting

Reviewed changes

Copilot reviewed 10 out of 18 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
prisma/schema.prisma Added Debian OpenSSL binary target for Docker compatibility
generated/prisma/* Auto-generated Prisma client files reflecting schema updates
package.json Added sharp dependency for image processing
package-lock.json Updated lock file with sharp dependencies moved to production
next.config.js Added standalone output mode for Docker deployment
Dockerfile New multi-stage production-ready Docker image configuration
docker-compose.yml Docker Compose orchestration file with environment variable examples
.dockerignore Excludes unnecessary files from Docker build context
.env.example Comprehensive environment variable template
README.md Updated self-hosting documentation and access instructions
.github/workflows/prs.yml PR automation workflow for labeling and validation
.github/workflows/deploy-docker.yml Docker build and publish workflow with security scanning
.github/labler.yml Configuration for automatic PR labeling (filename has typo)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
pr-message: |
👋 Thanks for opening your first pull request!
Copy link

Copilot AI Dec 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing whitespace present on line 65. This is inconsistent with the rest of the file and should be removed for better code hygiene.

Suggested change
👋 Thanks for opening your first pull request!
👋 Thanks for opening your first pull request!

Copilot uses AI. Check for mistakes.
ENV API_TOKEN="example"

# Reinstall build-time tools (eslint/typescript/prisma) via devDeps
ENV NODE_ENV=production
Copy link

Copilot AI Dec 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The NODE_ENV variable is redundantly set twice. Line 34 sets it to production, and then line 51 sets it again to the same value. The duplicate on line 51 should be removed as it serves no purpose and creates confusion.

Suggested change
ENV NODE_ENV=production

Copilot uses AI. Check for mistakes.
Comment on lines +13 to +30
- AUTH_SECRET=secret
- AUTH_GOOGLE_ID=googid
- AUTH_GOOGLE_SECRET=googsecret
- AUTH_TRUST_HOST=http://localhost:3000
- AUTH_RESEND_KEY="secret"
# MINIO
- MINIO_URL=url
- MINIO_BUCKET=bubblymaps
- MINIO_USER=user
- MINIO_PASS=pass
# BUBBLY MAPS API
- APP_URL=http://localhost:3000
- API_TOKEN="secret"
# LOGGING
- DISCORD_WEBHOOK_URL=url
# DEBUG
- APP_VERSION=v5.0.0
- API_VERSION=v5 No newline at end of file
Copy link

Copilot AI Dec 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent quoting of environment variable values. Some values use quotes (e.g., "secret" on lines 13, 17, 25) while others don't (e.g., url, user, pass on lines 19, 21, 22). For consistency and to avoid potential parsing issues, either quote all string values or remove quotes from all non-whitespace values.

Copilot uses AI. Check for mistakes.
ENV APP_URL="http://localhost:3000"
ENV API_TOKEN="example"

# Reinstall build-time tools (eslint/typescript/prisma) via devDeps
Copy link

Copilot AI Dec 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment on line 50 mentions "Reinstall build-time tools (eslint/typescript/prisma) via devDeps" but the following commands only install system packages (openssl, ca-certificates) and don't actually reinstall any Node.js devDependencies. This comment is misleading and should be updated to accurately describe what the commands do, such as "Install required system dependencies for build".

Suggested change
# Reinstall build-time tools (eslint/typescript/prisma) via devDeps
# Install required system dependencies for build (e.g., OpenSSL for Prisma)

Copilot uses AI. Check for mistakes.
docker compose up -d
```

Access your instance at ``http://localhost:3000``.
Copy link

Copilot AI Dec 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double backticks are used around the URL instead of a single pair. The correct markdown syntax should be a single backtick on each side: http://localhost:3000.

Suggested change
Access your instance at ``http://localhost:3000``.
Access your instance at `http://localhost:3000`.

Copilot uses AI. Check for mistakes.
Comment on lines +33 to +48
# INITIAL ENV
ENV NODE_ENV=production
ENV AUTH_RESEND_KEY="example"
ENV DATABASE_URL="postgresql://user:pass@host:5432/database?schema=public"
ENV AUTH_SECRET="example"
ENV AUTH_GOOGLE_ID="example"
ENV AUTH_GOOGLE_SECRET="example"
ENV AUTH_TRUST_HOST="http://localhost:3000"
ENV MINIO_URL="http://localhost:9000"
ENV MINIO_BUCKET="bubblymaps"
ENV MINIO_USER="minioadmin"
ENV MINIO_PASS="minioadmin"
ENV APP_VERSION="v5.0.0"
ENV API_VERSION="v5"
ENV APP_URL="http://localhost:3000"
ENV API_TOKEN="example"
Copy link

Copilot AI Dec 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hardcoded placeholder credentials like "minioadmin"/"minioadmin" (lines 43-44) and "example" values are present in the builder stage. While these are only used at build time for validation and not in the runtime image, consider documenting that these are dummy values required for the build process to pass environment variable validation, to avoid confusion about whether these credentials could pose a security risk.

Copilot uses AI. Check for mistakes.

- name: Scan image for vulnerabilities
if: github.event_name != 'pull_request'
uses: aquasecurity/trivy-action@master
Copy link

Copilot AI Dec 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using @master for the trivy-action is not a best practice as it references a branch instead of a specific version tag. This can lead to unexpected breaking changes when the master branch is updated. Consider using a specific version tag like @0.28.0 or a commit SHA to ensure reproducible builds.

Suggested change
uses: aquasecurity/trivy-action@master
uses: aquasecurity/trivy-action@0.28.0

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/cd configuration database dependencies Pull requests that update a dependency file docker documentation Improvements or additions to documentation release size/m v5

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants