From 8b3743fe6bab0f7055023f6b67e7dc4c60f0b72d Mon Sep 17 00:00:00 2001 From: Rishi Ghan Date: Mon, 18 Oct 2021 08:38:47 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Added=20a=20flag=20to=20docker-c?= =?UTF-8?q?ompose?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker-compose.yml | 14 ++++++++++++++ proxy.conf | 21 +++------------------ 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index cc0896a..822457d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,6 +12,8 @@ services: - "8050:8050" - "3050:3050" - "8051:8051" + extra_hosts: + - "host.docker.internal:host-gateway" depends_on: - rabbitmq - db @@ -30,6 +32,8 @@ services: container_name: comicvine-api ports: - "3080:3080" + extra_hosts: + - "host.docker.internal:host-gateway" environment: SERVICES: api env_file: ./docker-env/comicvine-service.env @@ -46,6 +50,8 @@ services: network: host image: frishi/comicvine-service container_name: comicvine-service + extra_hosts: + - "host.docker.internal:host-gateway" environment: SERVICES: comicvine volumes: @@ -60,6 +66,8 @@ services: network: host image: frishi/threetwo-import-service container_name: threetwo-import-api + extra_hosts: + - "host.docker.internal:host-gateway" ports: - "3000:3000" environment: @@ -80,6 +88,8 @@ services: network: host image: frishi/threetwo-import-service container_name: import + extra_hosts: + - "host.docker.internal:host-gateway" depends_on: - db - nats @@ -98,6 +108,8 @@ services: network: host image: frishi/threetwo-import-service container_name: image-transformation + extra_hosts: + - "host.docker.internal:host-gateway" volumes: - ./userdata:/threetwo-import-service/userdata - ./comics:/threetwo-import-service/comics @@ -129,6 +141,8 @@ services: nginx: image: nginx container_name: reverse-proxy + extra_hosts: + - "host.docker.internal:host-gateway" ports: - "80:80" volumes: diff --git a/proxy.conf b/proxy.conf index 010a683..308283e 100644 --- a/proxy.conf +++ b/proxy.conf @@ -1,22 +1,7 @@ server { listen 8050; location / { - if ($request_method = 'OPTIONS') { - add_header 'Access-Control-Max-Age' 1728000; - add_header 'Access-Control-Allow-Origin' '*'; - add_header 'Access-Control-Allow-Headers' 'Authorization,Accept,Origin,DNT,X-CustomHeader,Keep-Alive,User-Agent, - X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range'; - add_header 'Access-Control-Allow-Methods' 'GET,POST,OPTIONS,PUT,DELETE,PATCH'; - add_header 'Content-Type' 'application/json'; - add_header 'Content-Length' 0; - return 204; - } - - add_header 'Access-Control-Allow-Origin' '*'; - add_header 'Access-Control-Allow-Headers' 'Authorization,Accept,Origin,DNT,X-CustomHeader,Keep-Alive,User-Agent, - X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range'; - add_header 'Access-Control-Allow-Methods' 'GET,POST,OPTIONS,PUT,DELETE,PATCH'; - proxy_pass http://localhost:8050; + proxy_pass http://host.docker.internal:8050; } } @@ -25,7 +10,7 @@ server { listen 3080; location /comicvine-service { - proxy_pass http://localhost:3080; + proxy_pass http://host.docker.internal:3080; } } @@ -33,6 +18,6 @@ server { listen 3000; location /import { - proxy_pass http://localhost:3000; + proxy_pass http://host.docker.internal:3000; } } \ No newline at end of file