Files
ihaleist/Dockerfile
T
hikmettan 4f1ba88e94 deploy: canlı veri backend'ini container'a ekle (nginx /api → Node :3001)
- Dockerfile: nginx + Node tek container; backend arka planda, nginx ön planda
- nginx.conf: /api → 127.0.0.1:3001 proxy
- dt-store: node:sqlite guard (yoksa DT devre dışı, açık ihaleler yine canlı)
- Açık ihale canlı verisi sıfır npm bağımlılığıyla deploy'da çalışır
2026-08-26 21:28:25 +03:00

27 lines
742 B
Docker
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Stage 1: Vite SPA build
FROM node:22-alpine AS build
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
# Stage 2: nginx (frontend) + node (canlı veri backend) tek container'da
FROM node:22-alpine
RUN apk add --no-cache nginx
# Frontend
COPY --from=build /app/dist /usr/share/nginx/html
COPY --from=build /app/nginx.conf /etc/nginx/http.d/default.conf
# Backend (yalnızca Node builtin'leri kullanır — npm bağımlılığı yok)
WORKDIR /app
COPY --from=build /app/server ./server
# Başlangıç: Node backend'i (3001) arka planda + nginx ön planda
RUN printf '#!/bin/sh\nset -e\nnode /app/server/index.js &\nexec nginx -g "daemon off;"\n' > /start.sh \
&& chmod +x /start.sh
EXPOSE 80
CMD ["/start.sh"]