diff --git a/Dockerfile b/Dockerfile index f21deeb..df9e21c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -35,12 +35,10 @@ FROM node:18-alpine WORKDIR /app - COPY package*.json ./ RUN npm install - COPY . . -RUN npm run build EXPOSE 3000 -CMD ["npm", "start"] \ No newline at end of file +CMD ["npm", "start"] + diff --git a/docker-compose.yml b/docker-compose.yml index a2c52e2..91a7038 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -27,24 +27,24 @@ services: container_name: nextjs restart: always ports: - - "3000:3000" + - "3000:80" networks: - app-network - nginx: - image: nginx:alpine - container_name: nginx - ports: - - "80:80" - - "443:443" - volumes: - - ./nginx/conf.d:/etc/nginx/conf.d - - ./nginx/ssl:/etc/nginx/ssl - depends_on: - - nextjs - networks: - - app-network - restart: always + # nginx: + # image: nginx:alpine + # container_name: nginx + # ports: + # - "80:80" + # - "443:443" + # volumes: + # - ./nginx/conf.d:/etc/nginx/conf.d + # - ./nginx/ssl:/etc/nginx/ssl + # depends_on: + # - nextjs + # networks: + # - app-network + # restart: always networks: app-network: diff --git a/nginx.conf b/nginx.conf index 52f06da..ba8819a 100644 --- a/nginx.conf +++ b/nginx.conf @@ -20,16 +20,29 @@ # } # } +# server { +# listen 80; +# server_name anthillsib.ru www.anthillsib.ru; # Замените на ваш домен + +# location / { +# proxy_pass http://nextjs:3000; +# proxy_http_version 1.1; +# proxy_set_header Upgrade $http_upgrade; +# proxy_set_header Connection 'upgrade'; +# proxy_set_header Host $host; +# proxy_cache_bypass $http_upgrade; +# } +# } + server { listen 80; - server_name localhost:3000; # Замените на ваш домен + server_name localhost; location / { - proxy_pass http://nextjs:3000; + proxy_pass http://app:3000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; - proxy_cache_bypass $http_upgrade; } } \ No newline at end of file