Skip to content

Commit e33df39

Browse files
committed
added workflow
1 parent 5f81230 commit e33df39

2 files changed

Lines changed: 45 additions & 0 deletions

File tree

.github/workflows/build-docker.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Build Docker Image
2+
on:
3+
push:
4+
branches: [main, master]
5+
paths:
6+
- 'packages/server/**'
7+
pull_request:
8+
branches: [main, master]
9+
paths:
10+
- 'packages/server/**'
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
- name: Set up Docker Buildx
18+
uses: docker/setup-buildx-action@v3
19+
- name: Build Docker image
20+
uses: docker/build-push-action@v5
21+
with:
22+
context: ./packages/server
23+
file: ./packages/server/dockerfile
24+
push: false
25+
tags: proxyhub-server:latest
26+
cache-from: type=gha
27+
cache-to: type=gha,mode=max
28+
# - name: Upload Docker image as artifact
29+
# uses: actions/upload-artifact@v4
30+
# with:
31+
# name: docker-image
32+
# path: /tmp/_buildx_build
33+
# retention-days: 1

packages/server/dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM node:22.16.0-alpine
2+
3+
WORKDIR /app
4+
5+
COPY package*.json ./
6+
7+
RUN npm ci --only=production
8+
9+
RUN npm run build
10+
COPY . .
11+
12+
CMD ["npm", "start"]

0 commit comments

Comments
 (0)