Skip to content

Commit ae5e3c2

Browse files
committed
Build dockerfile
1 parent 9dad96d commit ae5e3c2

File tree

3 files changed

+55
-0
lines changed

3 files changed

+55
-0
lines changed

.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
public
2+
data
3+
node_modules

.github/workflows/docker.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
on:
2+
push:
3+
branches:
4+
- "main"
5+
tags:
6+
- "v*"
7+
name: Docker
8+
jobs:
9+
build:
10+
name: Build Container
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
packages: write
15+
timeout-minutes: 20
16+
steps:
17+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
18+
- name: Set up QEMU
19+
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
20+
- name: Set up Docker Buildx
21+
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
22+
- name: Login to Docker Hub
23+
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
24+
with:
25+
registry: ghcr.io
26+
username: ${{ github.actor }}
27+
password: ${{ secrets.GITHUB_TOKEN }}
28+
- name: Build and push Docker image
29+
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
30+
with:
31+
context: .
32+
file: ./Dockerfile
33+
platforms: linux/amd64,linux/arm64
34+
push: true
35+
tags: ghcr.io/lannonbr/weeknotes-dashboard:${{ github.ref_name }}
36+
- name: Prune old images
37+
uses: lannonbr/prune-containers-action@4ec3200295eae3441082fa83c2eb5aa3cacedb06 # 1.0.1
38+
with:
39+
container-name: weeknotes-dashboard
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM node:24-alpine
2+
3+
WORKDIR /opt
4+
5+
LABEL org.opencontainers.image.source=https://github.com/lannonbr/weeknotes-dashboard
6+
7+
COPY . .
8+
RUN npm install
9+
10+
ENTRYPOINT [ "npm" ]
11+
CMD ["run", "dev"]

0 commit comments

Comments
 (0)