-
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
7 changed files
with
5,757 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,43 @@ | ||
--- | ||
name: Build | ||
on: | ||
push: | ||
|
||
jobs: | ||
Build: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: docker/setup-buildx-action@v3 | ||
- uses: docker/metadata-action@v5 | ||
id: meta | ||
with: | ||
images: Build | ||
|
||
- name: Cache | ||
uses: actions/cache@v3 | ||
id: cache | ||
with: | ||
path: | | ||
pnpm | ||
key: cache-${{ hashFiles('pnpm-lock.yaml') }} | ||
|
||
- name: inject cache into docker | ||
uses: reproducible-containers/buildkit-cache-dance@v3.1.0 | ||
with: | ||
cache-map: | | ||
{ | ||
"pnpm": "/pnpm" | ||
} | ||
skip-extraction: ${{ steps.cache.outputs.cache-hit }} | ||
|
||
- name: Build | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
file: Dockerfile | ||
push: false | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
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 | ||
.idea |
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 @@ | ||
21 |
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,24 @@ | ||
FROM node:21-slim AS base | ||
|
||
ENV PNPM_HOME="/pnpm" | ||
|
||
RUN corepack enable | ||
|
||
# Copy your application code | ||
WORKDIR /app | ||
COPY . . | ||
|
||
RUN pnpm install --frozen-lockfile | ||
|
||
# Use a smaller Node.js image for the final image | ||
FROM node:alpine AS prod | ||
|
||
# Set working directory | ||
WORKDIR /app | ||
|
||
# Copy only the production dependencies and application code | ||
COPY --from=base /app/node_modules /app/node_modules | ||
COPY --from=base /app . | ||
|
||
CMD ["npm", "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 @@ | ||
console.log('Hello World!') |
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,22 @@ | ||
{ | ||
"name": "multifunctional-nodejs-app", | ||
"version": "1.0.0", | ||
"description": "A multifunctional Node.js application", | ||
"main": "index.js", | ||
"scripts": { | ||
"start": "node index.js", | ||
"test": "jest", | ||
"lint": "eslint ." | ||
}, | ||
"dependencies": { | ||
"@aws-sdk/core": "^3.567.0", | ||
"express": "^4.19.2", | ||
"node-gyp": "^10.1.0", | ||
"s3-zip": "^3.3.0", | ||
"unzipper": "^0.11.4" | ||
}, | ||
"devDependencies": { | ||
"eslint": "^9.1.1", | ||
"jest": "^29.7.0" | ||
} | ||
} |
Oops, something went wrong.