Skip to content

Commit 4811a51

Browse files
committed
first version 👍
1 parent 714579d commit 4811a51

20 files changed

+2097
-19
lines changed

.github/workflows/docker-image.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Docker Image CI
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
tags:
8+
- 'v*'
9+
10+
jobs:
11+
push_to_registry:
12+
name: Push Docker image to Docker Hub
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Check out the repo
16+
uses: actions/checkout@v4
17+
18+
- name: Set up QEMU
19+
uses: docker/setup-qemu-action@v3
20+
21+
- name: Set up Docker Buildx
22+
uses: docker/setup-buildx-action@v3
23+
24+
- name: Log in to Docker Hub
25+
uses: docker/login-action@v3
26+
with:
27+
username: ${{ secrets.DOCKERHUB_USERNAME }}
28+
password: ${{ secrets.DOCKERHUB_TOKEN }}
29+
30+
- name: Extract metadata (tags, labels) for Docker
31+
id: meta
32+
uses: docker/[email protected]
33+
with:
34+
images: codeinchq/watermarker
35+
36+
- name: Build and push Docker image
37+
uses: docker/build-push-action@v5
38+
with:
39+
context: .
40+
platforms: linux/amd64,linux/arm64
41+
target: watermarker-prod
42+
push: true
43+
tags: ${{ steps.meta.outputs.tags }}
44+
labels: ${{ steps.meta.outputs.labels }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.DS_Store
2+
/node_modules

.idea/.gitignore

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/jsLibraryMappings.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/php.xml

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/watermarker.iml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Dockerfile

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
####################################################################################################
2+
# WATERMARKER
3+
####################################################################################################
4+
FROM --platform=$TARGETPLATFORM node:21-alpine AS watermarker
5+
6+
ENV PORT=3000
7+
ENV NODE_ENV=production
8+
WORKDIR /app
9+
10+
11+
####################################################################################################
12+
# WATERMARKER dev
13+
####################################################################################################
14+
FROM watermarker AS watermarker-dev
15+
16+
ENV NODE_ENV=development
17+
RUN npm install --global nodemon
18+
19+
EXPOSE $PORT
20+
ENTRYPOINT ["nodemon", "main.mjs"]
21+
22+
23+
####################################################################################################
24+
# WATERMARKER prod
25+
####################################################################################################
26+
FROM watermarker AS watermarker-prod
27+
28+
COPY main.mjs /app/
29+
COPY package.json /app/
30+
COPY package-lock.json /app/
31+
RUN mkdir -p /app/temp
32+
RUN npm install --omit=dev
33+
34+
EXPOSE $PORT
35+
ENTRYPOINT ["node", "main.mjs"]

0 commit comments

Comments
 (0)