Skip to content

Commit e582cde

Browse files
committed
.
1 parent 57166f0 commit e582cde

File tree

2 files changed

+20
-8
lines changed

2 files changed

+20
-8
lines changed

Dockerfile

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
FROM node:22-slim
1+
# Build stage
2+
FROM node:22-slim AS builder
23

34
# Install build dependencies
45
RUN apt-get update && apt-get install -y --no-install-recommends \
@@ -25,8 +26,19 @@ COPY . .
2526
# Build the application
2627
RUN npm run build-only
2728

28-
# Expose Vite preview port
29-
EXPOSE 4173
29+
# Production stage
30+
FROM node:22-slim
31+
32+
WORKDIR /app
33+
34+
# Install serve globally (lightweight static file server for production)
35+
RUN npm install -g serve
36+
37+
# Copy built files from builder stage
38+
COPY --from=builder /app/dist ./dist
39+
40+
# Expose port
41+
EXPOSE 3000
3042

31-
# Start Vite preview server
32-
CMD ["npm", "run", "preview", "--", "--host", "0.0.0.0", "--port", "4173"]
43+
# Start serve (production static file server)
44+
CMD ["serve", "-s", "dist", "-l", "3000"]

k8s/deployment.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ spec:
1818
- name: bitbadges-explorer
1919
image: trevormil23/bitbadges-explorer:latest
2020
ports:
21-
- containerPort: 4173
21+
- containerPort: 3000
2222
envFrom:
2323
- configMapRef:
2424
name: bitbadges-explorer-config
@@ -32,12 +32,12 @@ spec:
3232
livenessProbe:
3333
httpGet:
3434
path: /
35-
port: 4173
35+
port: 3000
3636
initialDelaySeconds: 30
3737
periodSeconds: 10
3838
readinessProbe:
3939
httpGet:
4040
path: /
41-
port: 4173
41+
port: 3000
4242
initialDelaySeconds: 5
4343
periodSeconds: 5

0 commit comments

Comments
 (0)