test docker
This commit is contained in:
parent
f0c4c6ac2f
commit
90d9961592
@ -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"]
|
||||
CMD ["npm", "start"]
|
||||
|
||||
|
||||
@ -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:
|
||||
|
||||
19
nginx.conf
19
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;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user