This repository has been archived by the owner on Nov 11, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
2 changed files
with
63 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,18 @@ | ||
name: Build & Push Docker Image to container image registry | ||
|
||
on: | ||
release: | ||
types: [created] | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- "Dockerfile" | ||
|
||
jobs: | ||
docker: | ||
uses: clytage/workflows/.github/workflows/docker-build.yml@main | ||
secrets: inherit |
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,45 @@ | ||
FROM ghcr.io/hazmi35/node:20-dev-alpine as build-stage | ||
|
||
# Prepare pnpm with corepack (experimental feature) | ||
RUN corepack enable && corepack prepare pnpm@latest | ||
|
||
# Copy package.json, lockfile and npm config files | ||
COPY package.json pnpm-lock.yaml *.npmrc ./ | ||
|
||
# Fetch dependencies to virtual store | ||
RUN pnpm fetch | ||
|
||
# Install dependencies | ||
RUN pnpm install --offline --frozen-lockfile | ||
|
||
# Copy Project files | ||
COPY . . | ||
|
||
# Build TypeScript Project | ||
RUN pnpm run build | ||
|
||
# Prune devDependencies | ||
RUN pnpm prune --production | ||
|
||
# Get ready for production | ||
FROM ghcr.io/hazmi35/node:20-alpine | ||
|
||
LABEL name "bajigur" | ||
LABEL maintainer "Stegripe <[email protected]>" | ||
|
||
# Install ffmpeg | ||
RUN apk add --no-cache ffmpeg | ||
|
||
# Copy needed files | ||
COPY --from=build-stage /tmp/build/package.json . | ||
COPY --from=build-stage /tmp/build/node_modules ./node_modules | ||
COPY --from=build-stage /tmp/build/dist ./dist | ||
|
||
# Additional Environment Variables | ||
ENV NODE_ENV production | ||
|
||
# Add scripts volumes | ||
VOLUME /app/auth_state | ||
|
||
# Start the app with node | ||
CMD ["node", "dist/index.js"] |