Skip to content

Commit 10c1e31

Browse files
first commit
1 parent 0992fcf commit 10c1e31

File tree

4 files changed

+121
-0
lines changed

4 files changed

+121
-0
lines changed

.dockerignore

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
.yarn/install-state.gz
8+
9+
# testing
10+
/coverage
11+
12+
# next.js
13+
/.next/
14+
/out/
15+
16+
# production
17+
/build
18+
19+
# misc
20+
.DS_Store
21+
*.pem
22+
23+
# debug
24+
npm-debug.log*
25+
yarn-debug.log*
26+
yarn-error.log*
27+
28+
# local env files
29+
.env*.local
30+
31+
# vercel
32+
.vercel
33+
34+
# typescript
35+
*.tsbuildinfo
36+
next-env.d.ts

.github/workflows/fly-deploy.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# See https://fly.io/docs/app-guides/continuous-deployment-with-github-actions/
2+
3+
name: Fly Deploy
4+
on:
5+
push:
6+
branches:
7+
- main
8+
jobs:
9+
deploy:
10+
name: Deploy app
11+
runs-on: ubuntu-latest
12+
concurrency: deploy-group # optional: ensure only one action runs at a time
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: superfly/flyctl-actions/setup-flyctl@master
16+
- run: flyctl deploy --remote-only
17+
env:
18+
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}

Dockerfile

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# syntax = docker/dockerfile:1
2+
3+
# Adjust NODE_VERSION as desired
4+
ARG NODE_VERSION=20.17.0
5+
FROM node:${NODE_VERSION}-slim as base
6+
7+
LABEL fly_launch_runtime="Next.js"
8+
9+
# Next.js app lives here
10+
WORKDIR /app
11+
12+
# Set production environment
13+
ENV NODE_ENV="production"
14+
15+
16+
# Throw-away build stage to reduce size of final image
17+
FROM base as build
18+
19+
# Install packages needed to build node modules
20+
RUN apt-get update -qq && \
21+
apt-get install --no-install-recommends -y build-essential node-gyp pkg-config python-is-python3
22+
23+
# Install node modules
24+
COPY package-lock.json package.json ./
25+
RUN npm ci --include=dev
26+
27+
# Copy application code
28+
COPY . .
29+
30+
# Build application
31+
RUN npm run build
32+
33+
# Remove development dependencies
34+
RUN npm prune --omit=dev
35+
36+
37+
# Final stage for app image
38+
FROM base
39+
40+
# Copy built application
41+
COPY --from=build /app /app
42+
43+
# Start the server by default, this can be overwritten at runtime
44+
EXPOSE 3000
45+
CMD [ "npm", "run", "start" ]

fly.toml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# fly.toml app configuration file generated for nextjs-basic-autumn-sunset-4816 on 2024-12-19T18:52:44Z
2+
#
3+
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
4+
#
5+
6+
app = 'nextjs-basic-autumn-sunset-4816'
7+
primary_region = 'jnb'
8+
9+
[build]
10+
11+
[http_service]
12+
internal_port = 3000
13+
force_https = true
14+
auto_stop_machines = 'stop'
15+
auto_start_machines = true
16+
min_machines_running = 0
17+
processes = ['app']
18+
19+
[[vm]]
20+
memory = '1gb'
21+
cpu_kind = 'shared'
22+
cpus = 1

0 commit comments

Comments
 (0)