Simplify volume mount & Set container names for proxy_pass
This commit is contained in:
parent
6aeeb91485
commit
cb8a880300
@ -1,34 +1,28 @@
|
||||
name: myportfolio
|
||||
services:
|
||||
proxy:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
target: portfolio-proxy
|
||||
container_name: portfolio-proxy
|
||||
networks:
|
||||
- portfolio-net
|
||||
ports:
|
||||
- name: proxy-port
|
||||
target: 80
|
||||
published: "80"
|
||||
protocol: tcp
|
||||
app_protocol: http
|
||||
mode: host
|
||||
- "80:80/tcp"
|
||||
volumes:
|
||||
- ./nginx/default-nginx-proxy.conf:/etc/nginx/conf.d/default.conf:ro
|
||||
|
||||
- ./nginx/default-nginx-proxy.conf:/etc/nginx/conf.d/default.conf:ro
|
||||
|
||||
web:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
target: portfolio-web
|
||||
expose:
|
||||
- "8080/tcp"
|
||||
container_name: portfolio-web
|
||||
networks:
|
||||
- portfolio-net
|
||||
volumes:
|
||||
- ./nginx/default-nginx-web.conf:/etc/nginx/conf.d/default.conf:ro
|
||||
- portfolio-www:/www
|
||||
volumes:
|
||||
portfolio-www:
|
||||
driver: local
|
||||
driver_opts:
|
||||
type: none
|
||||
o: bind
|
||||
device: /home/admin/portfolio
|
||||
- ./nginx/default-nginx-web.conf:/etc/nginx/conf.d/default.conf:ro
|
||||
- ./src:/www
|
||||
|
||||
networks:
|
||||
portfolio-net:
|
||||
|
@ -3,25 +3,21 @@ server {
|
||||
listen [::]:80;
|
||||
server_name localhost;
|
||||
|
||||
#access_log /var/log/nginx/host.access.log main;
|
||||
|
||||
location / {
|
||||
proxy_buffering on;
|
||||
proxy_buffers 16 4k;
|
||||
proxy_buffer_size 4k;
|
||||
proxy_busy_buffers_size 8k;
|
||||
proxy_pass http://myportfolio-web-1:8080;
|
||||
proxy_pass http://portfolio-web:8080;
|
||||
}
|
||||
|
||||
#error_page 404 /404.html;
|
||||
|
||||
# redirect server error pages to the static page /50x.html
|
||||
#
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
location = /50x.html {
|
||||
root /usr/share/nginx/html;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
|
||||
#
|
||||
#location ~ \.php$ {
|
||||
@ -44,5 +40,4 @@ server {
|
||||
#location ~ /\.ht {
|
||||
# deny all;
|
||||
#}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user