-
Notifications
You must be signed in to change notification settings - Fork 3
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
02b3594
commit 64eb019
Showing
4 changed files
with
82 additions
and
3 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 @@ | ||
node_modules |
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,43 @@ | ||
name: build docker | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
|
||
concurrency: | ||
group: ${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Login to coding registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: bangbang93-docker.pkg.coding.net | ||
username: ${{ secrets.DOCKER_USER }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Extract Git Tag | ||
run: echo "GIT_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV | ||
|
||
- name: Build and push | ||
id: docker_build | ||
uses: docker/build-push-action@v4 | ||
env: | ||
IMAGE_TAG: ${{ env.GIT_TAG }} | ||
IMAGE_NAME: bangbang93-docker.pkg.coding.net/mirrors/bangbang93/freyja | ||
with: | ||
push: true | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
tags: | | ||
${{ env.IMAGE_NAME }}:latest | ||
${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }} |
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 @@ | ||
ARG BASE_IMAGE=node:18.18.0-alpine | ||
FROM $BASE_IMAGE AS build | ||
|
||
WORKDIR /app | ||
|
||
COPY package.json package-lock.json ./ | ||
RUN npm ci | ||
|
||
COPY client ./client | ||
RUN npm run build:client | ||
COPY src ./src | ||
COPY tsconfig.* nest-cli.json ./ | ||
RUN npm run build:server | ||
|
||
|
||
FROM $BASE_IMAGE AS dependencies | ||
|
||
WORKDIR /app | ||
|
||
COPY package.json package-lock.json ./ | ||
RUN npm ci --omit=dev | ||
|
||
FROM $BASE_IMAGE AS release | ||
|
||
RUN apk add --no-cache tini | ||
|
||
WORKDIR /app | ||
|
||
COPY public public | ||
COPY --from=dependencies /app/node_modules ./node_modules | ||
COPY --from=build /app/client/dist ./client/dist | ||
COPY --from=build /app/dist ./dist | ||
|
||
ENTRYPOINT ["/sbin/tini", "--"] | ||
CMD ["node", "--enable-source-maps", "dist/main.js"] |
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