-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
5 changed files
with
95 additions
and
0 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,14 @@ | ||
.git | ||
.gitignore | ||
|
||
Dockerfile | ||
.dockerignore | ||
|
||
# gitignore | ||
.vscode | ||
node_modules | ||
/.cache | ||
/build | ||
.env | ||
/local | ||
*.local.* |
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 }} |
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,40 @@ | ||
FROM node:20-slim AS base | ||
|
||
RUN apt-get update | ||
RUN apt-get -y install ca-certificates | ||
RUN corepack use pnpm@9 | ||
RUN corepack enable pnpm | ||
|
||
FROM base AS deps | ||
|
||
WORKDIR /app | ||
|
||
COPY package.json pnpm-lock.yaml ./ | ||
RUN pnpm install | ||
|
||
FROM deps AS prod-deps | ||
|
||
RUN pnpm prune --prod | ||
|
||
FROM deps AS build | ||
|
||
COPY . . | ||
|
||
RUN pnpm build | ||
|
||
FROM base | ||
|
||
ENV NODE_ENV production | ||
ENV PORT 3000 | ||
EXPOSE 3000 | ||
|
||
WORKDIR /app | ||
|
||
COPY --from=prod-deps /app/node_modules /app/node_modules | ||
COPY --from=build /app/build /app/build | ||
# COPY --from=build /app/public /app/public | ||
COPY --from=build /app/package.json /app/package.json | ||
COPY --from=build /app/server.js /app/server.js | ||
COPY --from=build /app/server-utils.js /app/server-utils.js | ||
|
||
CMD [ "pnpm","start" ] |
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,19 @@ | ||
# fly.toml app configuration file generated for polyglotize on 2024-12-23T17:26:18+08:00 | ||
# | ||
# See https://fly.io/docs/reference/configuration/ for information about how to use this file. | ||
# | ||
|
||
app = 'polyglotize' | ||
primary_region = 'hkg' | ||
swap_size_mb = 512 | ||
|
||
[http_service] | ||
internal_port = 3000 | ||
force_https = true | ||
auto_stop_machines = 'stop' | ||
auto_start_machines = true | ||
|
||
[[vm]] | ||
cpu_kind = 'shared' | ||
cpus = 1 | ||
memory_mb = 256 |
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