-
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.
🎇 merge pull request #46 from devsoc-unsw/feature/deployment
🐳 ready for deployment (#45)
- Loading branch information
Showing
17 changed files
with
386 additions
and
172 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
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,2 @@ | ||
node_modules | ||
Dockerfile |
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,35 @@ | ||
FROM node:22.10.0-alpine AS base | ||
ENV PNPM_HOME="/pnpm" | ||
ENV PATH="$PNPM_HOME:$PATH" | ||
RUN corepack enable | ||
|
||
# install dependencies for compiling bcrypt | ||
RUN apk --no-cache add --virtual builds-deps build-base python3 | ||
|
||
COPY . /yellowshirt-backend | ||
WORKDIR /yellowshirt-backend | ||
|
||
FROM base AS prod-deps | ||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod | ||
|
||
ENV NODE_ENV=production | ||
|
||
# envs to set for runtime | ||
# if using fly, env vars can be specified in fly.toml | ||
|
||
#ENV ALLOWED_ORIGINS=/yellowshirt\.xyz$/,/trainee-woodelf-24t2\.pages\.dev$/,/yellowshirt-backend\.fly\.dev$/ | ||
|
||
# ⚠️ SESSION_SECRET should be, well, a secret! | ||
# if using fly, use fly secrets | ||
#ENV SESSION_SECRET=... | ||
|
||
FROM base AS build | ||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install && pnpm rebuild bcrypt | ||
RUN pnpm run build | ||
|
||
FROM base | ||
COPY --from=prod-deps /yellowshirt-backend/node_modules /yellowshirt-backend/node_modules | ||
COPY --from=build /yellowshirt-backend/dist /yellowshirt-backend/dist | ||
|
||
EXPOSE 3000 | ||
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,25 @@ | ||
# fly.toml app configuration file generated for yellowshirt-backend on 2024-10-18T15:00:04+11:00 | ||
# | ||
# See https://fly.io/docs/reference/configuration/ for information about how to use this file. | ||
# | ||
|
||
app = 'yellowshirt-backend' | ||
primary_region = 'syd' | ||
|
||
[build] | ||
|
||
[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 | ||
|
||
[env] | ||
ALLOWED_ORIGINS = 'yellowshirt\.xyz$,trainee-woodelf-24t2\.pages\.dev$,yellowshirt-backend\.fly\.dev$' |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.