forked from NejcZivic/yatb-site
-
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.
dockerize and modify option categories
- Loading branch information
1 parent
d532d16
commit 2a748a9
Showing
3 changed files
with
54 additions
and
1 deletion.
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,17 @@ | ||
name: Docker Build | ||
on: [push, pull_request] | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Docker Build | ||
id: build | ||
uses: luludotdev/docker-build@master | ||
with: | ||
image-name: yatb-site | ||
token: ${{ secrets.GITHUB_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,33 @@ | ||
FROM node:22-alpine AS base | ||
FROM base AS builder | ||
|
||
WORKDIR /app | ||
COPY package.json package-lock.json tsconfig.json ./ | ||
RUN npm ci | ||
|
||
COPY src/ src/ | ||
RUN npm run build | ||
|
||
FROM base AS deps | ||
WORKDIR /app | ||
COPY package.json package-lock.json ./ | ||
RUN npm ci --omit=dev | ||
|
||
FROM base | ||
WORKDIR /app | ||
|
||
RUN \ | ||
addgroup --system --gid 1001 nodejs && \ | ||
adduser --system --uid 1001 nodejs | ||
|
||
COPY --chown=1001:1001 assets/ ./assets | ||
COPY --chown=1001:1001 package.json ./ | ||
COPY --chown=1001:1001 --from=deps /app/node_modules ./node_modules | ||
COPY --chown=1001:1001 --from=builder /app/build ./build | ||
|
||
USER nodejs | ||
EXPOSE 3000 | ||
ENV NODE_ENV=production | ||
ENV IS_DOCKER=true | ||
|
||
CMD ["npm", "run", "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