feat(docker): docker-compose.dev — backend+nginx, общий Postgres, миграции в entrypoint

Made-with: Cursor
This commit is contained in:
Константин Лебединский
2026-04-24 20:36:49 +05:00
parent 8ffd104f64
commit 89da5b60b7
8 changed files with 106 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
node_modules
dist
.env
.env.*
.git
+13
View File
@@ -0,0 +1,13 @@
# Build SPA
FROM node:20-alpine AS build
WORKDIR /app
COPY package.json package-lock.json* ./
RUN npm ci
COPY . .
RUN npm run build
# Static + API proxy
FROM nginx:1.25-alpine
COPY --from=build /app/dist /usr/share/nginx/html
COPY nginx-default.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
+18
View File
@@ -0,0 +1,18 @@
server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
location /api/ {
proxy_pass http://testing-backend:3001;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Cookie $http_cookie;
}
}