-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3238073
commit 31e1916
Showing
8 changed files
with
106 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# See https://fly.io/docs/app-guides/continuous-deployment-with-github-actions/ | ||
|
||
name: Fly Deploy | ||
on: | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
deploy: | ||
name: Deploy app | ||
runs-on: ubuntu-latest | ||
concurrency: deploy-group # optional: ensure only one action runs at a time | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: superfly/flyctl-actions/setup-flyctl@master | ||
- run: flyctl deploy --remote-only | ||
env: | ||
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# syntax = docker/dockerfile:1 | ||
|
||
# Adjust NODE_VERSION as desired | ||
ARG NODE_VERSION=22.9.0 | ||
FROM node:${NODE_VERSION}-slim as base | ||
|
||
LABEL fly_launch_runtime="Node.js/Prisma" | ||
|
||
# Node.js/Prisma app lives here | ||
WORKDIR /app | ||
|
||
# Set production environment | ||
ENV NODE_ENV="production" | ||
|
||
# Install pnpm | ||
ARG PNPM_VERSION=9.11.0 | ||
RUN npm install -g pnpm@$PNPM_VERSION | ||
|
||
|
||
# Throw-away build stage to reduce size of final image | ||
FROM base as build | ||
|
||
# Install packages needed to build node modules | ||
RUN apt-get update -qq && \ | ||
apt-get install --no-install-recommends -y build-essential node-gyp openssl pkg-config python-is-python3 | ||
|
||
# Install node modules | ||
COPY package.json pnpm-lock.yaml ./ | ||
RUN pnpm install --frozen-lockfile --prod=false | ||
|
||
# Generate Prisma Client | ||
COPY prisma . | ||
RUN npx prisma generate | ||
|
||
# Copy application code | ||
COPY . . | ||
|
||
# Build application | ||
RUN pnpm run build | ||
|
||
# Remove development dependencies | ||
RUN pnpm prune --prod | ||
|
||
|
||
# Final stage for app image | ||
FROM base | ||
|
||
# Install packages needed for deployment | ||
RUN apt-get update -qq && \ | ||
apt-get install --no-install-recommends -y chromium chromium-sandbox openssl && \ | ||
rm -rf /var/lib/apt/lists /var/cache/apt/archives | ||
|
||
# Copy built application | ||
COPY --from=build /app /app | ||
|
||
# Start the server by default, this can be overwritten at runtime | ||
EXPOSE 3000 | ||
ENV PUPPETEER_EXECUTABLE_PATH="/usr/bin/chromium" | ||
CMD [ "pnpm", "run", "start" ] |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# fly.toml app configuration file generated for phishdirectory-api on 2024-10-29T00:30:08-04:00 | ||
# | ||
# See https://fly.io/docs/reference/configuration/ for information about how to use this file. | ||
# | ||
|
||
app = 'phishdirectory-api' | ||
primary_region = 'yul' | ||
kill_signal = 'SIGINT' | ||
kill_timeout = '5s' | ||
|
||
[build] | ||
|
||
[deploy] | ||
release_command = 'npx prisma migrate dev' | ||
|
||
[http_service] | ||
internal_port = 3000 | ||
force_https = true | ||
auto_stop_machines = 'stop' | ||
auto_start_machines = true | ||
min_machines_running = 0 | ||
processes = ['app'] | ||
|
||
[[vm]] | ||
memory = '1gb' | ||
cpu_kind = 'shared' | ||
cpus = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,22 +10,13 @@ | |
"url": "https://jaspermayone.com" | ||
} | ||
], | ||
"packageManager": "[email protected]", | ||
"scripts": { | ||
"preinstall": "npx only-allow pnpm", | ||
"start": "node dist/index.js", | ||
"postinstall": "npx prisma generate && tsc", | ||
"watch-node": "nodemon dist/index.js", | ||
"watch-ts": "tsc -w", | ||
"dev": "nodemon --quiet --watch './**/*.ts' --exec 'ts-node' src/index.ts", | ||
"build": "npx prisma generate && tsc", | ||
"compile": "npx prisma generate && tsc", | ||
"heroku-prebuild": "echo This runs before Heroku installs dependencies.", | ||
"heroku-postbuild": "echo This runs after Heroku installs dependencies, but before Heroku prunes and caches dependencies.", | ||
"heroku-cleanup": "echo This runs after Heroku prunes and caches dependencies.", | ||
"prepare": "husky", | ||
"prisma:docker": "npx prisma generate && npx prisma migrate dev", | ||
"dev:docker": "pnpm prisma:docker && pnpm dev" | ||
"compile": "npx prisma generate && tsc" | ||
}, | ||
"keywords": [], | ||
"author": "Jasper Mayone <[email protected]>", | ||
|
@@ -56,14 +47,12 @@ | |
"@types/node-statsd": "^0.1.6", | ||
"@types/request-ip": "^0.0.41", | ||
"@types/response-time": "^2.3.8", | ||
"husky": "^9.1.4", | ||
"nodemon": "^3.1.4", | ||
"prisma": "^5.18.0", | ||
"typescript": "^5.5.4" | ||
}, | ||
"engines": { | ||
"node": "22.x", | ||
"npm": "10.8.2", | ||
"pnpm": "9.5.0" | ||
"npm": "10.8.2" | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.