Skip to content

Chore/add fly deployment#8

Open
nicholas-garcia-scholtz wants to merge 2 commits intomainfrom
chore/add-fly-deployment
Open

Chore/add fly deployment#8
nicholas-garcia-scholtz wants to merge 2 commits intomainfrom
chore/add-fly-deployment

Conversation

@nicholas-garcia-scholtz
Copy link
Copy Markdown
Contributor

Fly Deployment

Type of change

  • Chore / config

Description

  • Added the set up for the fly deployment

Copilot AI review requested due to automatic review settings April 10, 2026 14:35
Copy link
Copy Markdown

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

Adds Fly.io deployment support for the combined web + cms Next.js apps by introducing a Docker-based runtime (nginx reverse proxy + two standalone Next servers) and GitHub Actions workflows for deploy + PR notifications.

Changes:

  • Enable Next.js output: 'standalone' for both web and cms builds.
  • Add Fly.io deploy configuration (fly.toml), container runtime (Dockerfile + nginx.conf), and docker build context rules (.dockerignore).
  • Add GitHub Actions workflows for Fly deploy on main and Discord PR notifications.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
web/next.config.ts Enables standalone output to support Docker runtime packaging.
cms/next.config.mjs Enables standalone output for the CMS Next.js build.
Dockerfile Multi-stage build producing two standalone Next servers plus nginx reverse proxy.
nginx.conf Routes /admin + /api to CMS and everything else to web via nginx.
fly.toml Fly app/service configuration targeting internal port 80.
.dockerignore Reduces Docker build context size by excluding common artifacts.
.github/workflows/fly-deploy.yml Deploys to Fly on pushes to main (and manual dispatch).
.github/workflows/notification.yml Sends Discord notifications on PR opened/reopened/merged.

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

concurrency: deploy-group
steps:
- uses: actions/checkout@v4
- uses: superfly/flyctl-actions/setup-flyctl@master

jobs:
pull_request_created:
if: github.event_name == 'pull_request' && github.event.action == 'opened' || github.event.action == 'reopened'
Comment on lines +10 to +16
location /admin {
proxy_pass http://localhost:3001;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
}
Comment on lines +10 to +24
location /admin {
proxy_pass http://localhost:3001;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
}

location /api {
proxy_pass http://localhost:3001;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
}

EXPOSE 80

CMD sh -c "nginx -g 'daemon off;' & PORT=3001 node /app/cms/server.js & PORT=3000 node /app/web/server.js & wait" No newline at end of file
Comment on lines +33 to +52
FROM base AS runner
WORKDIR /app

ENV NODE_ENV=production

# CMS
COPY --from=cms-builder /app/cms/.next/standalone ./cms/
COPY --from=cms-builder /app/cms/.next/static ./cms/.next/static

# WEB
COPY --from=web-builder /app/web/.next/standalone ./web/
COPY --from=web-builder /app/web/.next/static ./web/.next/static
COPY --from=web-builder /app/web/public ./web/public

# nginx
COPY nginx.conf /etc/nginx/nginx.conf

EXPOSE 80

CMD sh -c "nginx -g 'daemon off;' & PORT=3001 node /app/cms/server.js & PORT=3000 node /app/web/server.js & wait" No newline at end of file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants