Skip to content

Commit 5c2ead0

Browse files
committed
fix: cleanup client/server docker
1 parent 523724c commit 5c2ead0

File tree

6 files changed

+23
-170
lines changed

6 files changed

+23
-170
lines changed

.github/workflows/release.yml

Lines changed: 5 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ jobs:
7373
- name: Build client
7474
run: npm run build --workspace=client
7575

76-
# Build and push Docker images
76+
# Build and push Docker image
7777
docker:
78-
name: Build and Push Docker Images
78+
name: Build and Push Docker Image
7979
runs-on: ubuntu-latest
8080
needs: [build]
8181
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
@@ -104,7 +104,7 @@ jobs:
104104
VERSION=$(node -p "require('./package.json').version")
105105
echo "version=$VERSION" >> $GITHUB_OUTPUT
106106
107-
- name: Extract metadata for Docker (combined image)
107+
- name: Extract metadata for Docker
108108
id: meta
109109
uses: docker/metadata-action@v5
110110
with:
@@ -117,7 +117,7 @@ jobs:
117117
type=semver,pattern={{major}},value=${{ steps.package_version.outputs.version }}
118118
type=raw,value=latest,enable={{is_default_branch}}
119119
120-
- name: Build and push combined Docker image
120+
- name: Build and push Docker image
121121
uses: docker/build-push-action@v5
122122
with:
123123
context: .
@@ -129,71 +129,10 @@ jobs:
129129
cache-to: type=gha,mode=max
130130
platforms: linux/amd64,linux/arm64
131131

132-
- name: Extract metadata for Server
133-
id: meta_server
134-
uses: docker/metadata-action@v5
135-
with:
136-
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-server
137-
tags: |
138-
type=ref,event=branch
139-
type=sha,prefix={{branch}}-
140-
type=semver,pattern={{version}},value=${{ steps.package_version.outputs.version }}
141-
type=semver,pattern={{major}}.{{minor}},value=${{ steps.package_version.outputs.version }}
142-
type=semver,pattern={{major}},value=${{ steps.package_version.outputs.version }}
143-
type=raw,value=latest,enable={{is_default_branch}}
144-
145-
- name: Build and push Server Docker image
146-
uses: docker/build-push-action@v5
147-
with:
148-
context: .
149-
file: ./Dockerfile.server
150-
push: true
151-
tags: ${{ steps.meta_server.outputs.tags }}
152-
labels: ${{ steps.meta_server.outputs.labels }}
153-
cache-from: type=gha
154-
cache-to: type=gha,mode=max
155-
platforms: linux/amd64,linux/arm64
156-
157-
- name: Extract metadata for Client
158-
id: meta_client
159-
uses: docker/metadata-action@v5
160-
with:
161-
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-client
162-
tags: |
163-
type=ref,event=branch
164-
type=sha,prefix={{branch}}-
165-
type=semver,pattern={{version}},value=${{ steps.package_version.outputs.version }}
166-
type=semver,pattern={{major}}.{{minor}},value=${{ steps.package_version.outputs.version }}
167-
type=semver,pattern={{major}},value=${{ steps.package_version.outputs.version }}
168-
type=raw,value=latest,enable={{is_default_branch}}
169-
170-
- name: Build and push Client Docker image
171-
uses: docker/build-push-action@v5
172-
with:
173-
context: .
174-
file: ./Dockerfile.client
175-
push: true
176-
tags: ${{ steps.meta_client.outputs.tags }}
177-
labels: ${{ steps.meta_client.outputs.labels }}
178-
cache-from: type=gha
179-
cache-to: type=gha,mode=max
180-
platforms: linux/amd64,linux/arm64
181-
182132
- name: Generate image summary
183133
run: |
184-
echo "## Docker Images Published 🚀" >> $GITHUB_STEP_SUMMARY
134+
echo "## Docker Image Published 🚀" >> $GITHUB_STEP_SUMMARY
185135
echo "" >> $GITHUB_STEP_SUMMARY
186-
echo "### Combined Image" >> $GITHUB_STEP_SUMMARY
187136
echo '```' >> $GITHUB_STEP_SUMMARY
188137
echo "${{ steps.meta.outputs.tags }}" >> $GITHUB_STEP_SUMMARY
189138
echo '```' >> $GITHUB_STEP_SUMMARY
190-
echo "" >> $GITHUB_STEP_SUMMARY
191-
echo "### Server Image" >> $GITHUB_STEP_SUMMARY
192-
echo '```' >> $GITHUB_STEP_SUMMARY
193-
echo "${{ steps.meta_server.outputs.tags }}" >> $GITHUB_STEP_SUMMARY
194-
echo '```' >> $GITHUB_STEP_SUMMARY
195-
echo "" >> $GITHUB_STEP_SUMMARY
196-
echo "### Client Image" >> $GITHUB_STEP_SUMMARY
197-
echo '```' >> $GITHUB_STEP_SUMMARY
198-
echo "${{ steps.meta_client.outputs.tags }}" >> $GITHUB_STEP_SUMMARY
199-
echo '```' >> $GITHUB_STEP_SUMMARY

CONTRIBUTING.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ Common scopes include:
177177
7. **Merge**
178178
- Once approved and CI passes, the PR will be merged
179179
- Semantic versioning will automatically determine the version bump
180-
- Docker images will be built and published
180+
- Docker image will be built and published
181181

182182
---
183183

@@ -231,11 +231,9 @@ Versions are automatically determined from commit messages:
231231

232232
## Docker Images
233233

234-
Docker images are automatically built and published to GitHub Container Registry on every merge to `main`:
234+
A Docker image is automatically built and published to GitHub Container Registry on every merge to `main`:
235235

236-
- `ghcr.io/liatrio/planning-poker:latest` - Combined client + server
237-
- `ghcr.io/liatrio/planning-poker-server:latest` - Server only
238-
- `ghcr.io/liatrio/planning-poker-client:latest` - Client only
236+
- `ghcr.io/liatrio/planning-poker:latest`
239237

240238
Images are tagged with:
241239
- `latest` - Most recent main build

Dockerfile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33

44
FROM node:20-alpine AS builder
55

6+
# Install OpenSSL for Prisma
7+
RUN apk add --no-cache openssl
8+
69
WORKDIR /app
710

811
# Copy package files including lockfile
@@ -28,19 +31,23 @@ RUN npm run build
2831
# Production stage
2932
FROM node:20-alpine
3033

31-
# Install nginx
32-
RUN apk add --no-cache nginx
34+
# Install nginx and OpenSSL for Prisma
35+
RUN apk add --no-cache nginx openssl
3336

3437
WORKDIR /app
3538

3639
# Copy server package files and built code
3740
COPY --from=builder /app/server/package.json ./server/
3841
COPY --from=builder /app/server/dist ./server/dist
42+
COPY --from=builder /app/server/prisma ./server/prisma
3943

4044
# Install only production dependencies for server
4145
WORKDIR /app/server
4246
RUN npm install --production
4347

48+
# Generate Prisma client
49+
RUN npx prisma generate
50+
4451
# Copy built client files to nginx html directory
4552
COPY --from=builder /app/client/dist /usr/share/nginx/html
4653

Dockerfile.client

Lines changed: 0 additions & 37 deletions
This file was deleted.

Dockerfile.server

Lines changed: 0 additions & 48 deletions
This file was deleted.

README.md

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -296,23 +296,17 @@ docker run -p 80:80 -e DATABASE_URL="..." ghcr.io/liatrio/planning-poker:latest
296296

297297
Pre-built Docker images are available from GitHub Container Registry:
298298

299-
**Combined (Client + Server)**
300299
```bash
301300
docker pull ghcr.io/liatrio/planning-poker:latest
302301
docker pull ghcr.io/liatrio/planning-poker:1.0.0
303302
```
304303

305-
**Server Only**
306-
```bash
307-
docker pull ghcr.io/liatrio/planning-poker-server:latest
308-
docker pull ghcr.io/liatrio/planning-poker-server:1.0.0
309-
```
310-
311-
**Client Only**
312-
```bash
313-
docker pull ghcr.io/liatrio/planning-poker-client:latest
314-
docker pull ghcr.io/liatrio/planning-poker-client:1.0.0
315-
```
304+
Images are tagged with:
305+
- `latest` - Most recent main build
306+
- `<version>` - Semantic version (e.g., `1.2.3`)
307+
- `<major>.<minor>` - Major + minor version (e.g., `1.2`)
308+
- `<major>` - Major version only (e.g., `1`)
309+
- `main-<sha>` - Git commit SHA
316310

317311
Images are tagged with:
318312
- `latest` - Most recent build from main branch

0 commit comments

Comments
 (0)