Skip to content

Commit 88a2535

Browse files
brian033claude
andcommitted
deploy: add Dockerfile and docker-compose for nginx-based deployment
Multi-stage build (Node + nginx) to replace WordPress container. Serves Vite SPA on port 10001 with client-side routing fallback. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent edc6efc commit 88a2535

4 files changed

Lines changed: 34 additions & 0 deletions

File tree

.dockerignore

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

Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM node:22-alpine AS build
2+
WORKDIR /app
3+
COPY package.json package-lock.json ./
4+
RUN npm ci
5+
COPY . .
6+
RUN npm run build
7+
8+
FROM nginx:alpine
9+
COPY --from=build /app/dist /usr/share/nginx/html
10+
COPY nginx.conf /etc/nginx/conf.d/default.conf
11+
EXPOSE 80

docker-compose.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
services:
2+
web:
3+
build: .
4+
ports:
5+
- "10001:80"
6+
restart: always

nginx.conf

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
server {
2+
listen 80;
3+
root /usr/share/nginx/html;
4+
index index.html;
5+
6+
location / {
7+
try_files $uri $uri/ /index.html;
8+
}
9+
10+
location /assets/ {
11+
expires 1y;
12+
add_header Cache-Control "public, immutable";
13+
}
14+
}

0 commit comments

Comments
 (0)