fix docker compose

This commit is contained in:
Zikil 2024-10-31 17:18:23 +07:00
parent 03c651e910
commit f195a33f79
3 changed files with 8 additions and 6 deletions

View File

@ -13,19 +13,20 @@ RUN npm ci
COPY . . COPY . .
# Собираем приложение # Собираем приложение
RUN npm run build # RUN npm run build
CMD ["npm", "run", "start" ]
# Stage 2: Настройка production-окружения # Stage 2: Настройка production-окружения
FROM nginx:alpine # FROM nginx:alpine
# Копируем собранные файлы из предыдущего этапа # Копируем собранные файлы из предыдущего этапа
# COPY --from=builder /app/dist /usr/share/nginx/html # COPY --from=builder /app/dist /usr/share/nginx/html
# Копируем конфигурацию nginx # # Копируем конфигурацию nginx
COPY nginx.conf /etc/nginx/conf.d/default.conf # COPY nginx.conf /etc/nginx/conf.d/default.conf
# Открываем порт 80 # Открываем порт 80
EXPOSE 80 EXPOSE 80
# Запускаем nginx # Запускаем nginx
CMD ["nginx", "-g", "daemon off;"] # CMD ["nginx", "-g", "daemon off;"]

View File

@ -7,6 +7,7 @@ services:
dockerfile: Dockerfile dockerfile: Dockerfile
ports: ports:
- "80:80" - "80:80"
- "3000:3000"
restart: unless-stopped restart: unless-stopped
# Добавьте volumes если нужно хранить данные постоянно # Добавьте volumes если нужно хранить данные постоянно
# volumes: # volumes:

View File

@ -1,6 +1,6 @@
server { server {
listen 80; listen 80;
server_name localhost; server_name localhost:3000;
location / { location / {
root /usr/share/nginx/html; root /usr/share/nginx/html;