-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
20 lines (17 loc) · 774 Bytes
/
Copy pathDockerfile
File metadata and controls
20 lines (17 loc) · 774 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Multi-stage build for YT Studio
# Stage 1: Build
FROM node:22-alpine AS builder
WORKDIR /app
RUN npm install -g pnpm@10
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile
COPY . .
RUN pnpm run build
# Stage 2: Runtime
FROM nginx:alpine
WORKDIR /usr/share/nginx/html
COPY --from=builder /app/dist .
# Nginx config
RUN printf 'server {\n listen 80;\n server_name _;\n root /usr/share/nginx/html;\n location / {\n try_files $uri $uri/ /index.html;\n }\n location /api/ {\n proxy_pass https://yt-studio-production.ruhdevopsytstudio.workers.dev/;\n proxy_http_version 1.1;\n proxy_set_header Host yt-studio-production.ruhdevopsytstudio.workers.dev;\n }\n}' > /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]