Add deployment scaffolding (Dockerfile, docker-compose, nginx)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
c6259e0d8c
commit
f046f2bc48
|
|
@ -0,0 +1,22 @@
|
|||
FROM node:20-alpine AS builder
|
||||
|
||||
# Install pnpm
|
||||
RUN corepack enable && corepack prepare pnpm@latest --activate
|
||||
|
||||
WORKDIR /app
|
||||
COPY package.json pnpm-lock.yaml ./
|
||||
RUN pnpm install --frozen-lockfile
|
||||
|
||||
COPY . .
|
||||
RUN pnpm build
|
||||
|
||||
# Production - serve static files with nginx
|
||||
FROM nginx:alpine
|
||||
|
||||
COPY --from=builder /app/out /usr/share/nginx/html
|
||||
|
||||
# Create nginx config
|
||||
RUN echo 'server { listen 80; server_name _; root /usr/share/nginx/html; index index.html; location / { try_files $uri $uri.html $uri/ /index.html; } location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2)$ { expires 1y; add_header Cache-Control "public, immutable"; } }' > /etc/nginx/conf.d/default.conf
|
||||
|
||||
EXPOSE 80
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
services:
|
||||
bondingcurve-prod:
|
||||
build: .
|
||||
container_name: bondingcurve-prod
|
||||
restart: unless-stopped
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.bondingcurve.rule=Host(`bondingcurve.tech`) || Host(`www.bondingcurve.tech`)"
|
||||
- "traefik.http.routers.bondingcurve.entrypoints=web"
|
||||
- "traefik.http.services.bondingcurve.loadbalancer.server.port=80"
|
||||
networks:
|
||||
- traefik-public
|
||||
|
||||
networks:
|
||||
traefik-public:
|
||||
external: true
|
||||
Loading…
Reference in New Issue