Skip to content
This repository has been archived by the owner on Aug 27, 2024. It is now read-only.

Commit

Permalink
Replace P6 Proxy by Nginx
Browse files Browse the repository at this point in the history
  • Loading branch information
choucrifahed committed May 12, 2020
1 parent 273bb52 commit b7989d1
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 41 deletions.
1 change: 0 additions & 1 deletion docker-compose/deploy/app-developer/.env
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ PGSQL_VERSION=11.7-alpine
P6CORE_IMAGE_ID=amalto/platform6
P6CORE_VERSION=latest
P6CORE_DATA=p6core.data
PROXY_ENV=prod
INSTANCE_ID=unnamed
PLATFORM6_DATA_PATH=~/platform6/instances
CLIENT_ID=client-id-in-here
Expand Down
21 changes: 8 additions & 13 deletions docker-compose/deploy/app-developer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,24 +57,19 @@ services:
retries: 5
start_period: 5m

p6proxy:
container_name: p6proxy
image: amalto/p6proxy
proxy:
container_name: proxy
image: nginx:1.18-alpine
depends_on:
- p6core
volumes:
- ../../scripts/proxy_healthcheck.sh:/opt/proxy_healthcheck.sh:ro
environment:
- PROXY_PLAIN_PORT=8480
- PROXY_SSL_PORT=8483
- LOG_FORMAT=string
- LOG_LEVEL=5
- PROXY_NO_SSL=false
- PROXY_NO_CACHE=true
- PROXY_ENV=${PROXY_ENV}
- ../../reference/proxy.conf:/etc/nginx/conf.d/proxy.conf:ro
- ${PLATFORM6_DATA_PATH}/${INSTANCE_ID}/nginx/logs:/var/log/nginx:delegated
ports:
- "8480:8480"
- "8483:8483"
healthcheck:
test: ["CMD", "/opt/proxy_healthcheck.sh"]
test: ["CMD", "wget", "-q", "-O", "-", "http://localhost:8480"]
interval: 10s
timeout: 30s
retries: 5
Expand Down
1 change: 0 additions & 1 deletion docker-compose/deploy/demobc-developer/.env
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ PGSQL_VERSION=11.7-alpine
P6CORE_IMAGE_ID=amalto/platform6
P6CORE_VERSION=latest
P6CORE_DATA=p6core.data
PROXY_ENV=prod
INSTANCE_ID=unnamed
PLATFORM6_DATA_PATH=~/platform6/instances
CLIENT_ID=client-id-in-here
Expand Down
21 changes: 8 additions & 13 deletions docker-compose/deploy/demobc-developer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,24 +58,19 @@ services:
retries: 5
start_period: 5m

p6proxy:
container_name: p6proxy
image: amalto/p6proxy
proxy:
container_name: proxy
image: nginx:1.18-alpine
depends_on:
- p6core
volumes:
- ../../scripts/proxy_healthcheck.sh:/opt/proxy_healthcheck.sh:ro
environment:
- PROXY_PLAIN_PORT=8480
- PROXY_SSL_PORT=8483
- LOG_FORMAT=string
- LOG_LEVEL=5
- PROXY_NO_SSL=false
- PROXY_NO_CACHE=true
- PROXY_ENV=${PROXY_ENV}
- ../../reference/proxy.conf:/etc/nginx/conf.d/proxy.conf:ro
- ${PLATFORM6_DATA_PATH}/${INSTANCE_ID}/nginx/logs:/var/log/nginx:delegated
ports:
- "8480:8480"
- "8483:8483"
healthcheck:
test: ["CMD", "/opt/proxy_healthcheck.sh"]
test: ["CMD", "wget", "-q", "-O", "-", "http://localhost:8480"]
interval: 10s
timeout: 30s
retries: 5
Expand Down
27 changes: 27 additions & 0 deletions docker-compose/reference/proxy.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
server {
server_name _;
listen 8480;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log debug;

if ($arg_baseUrl) {
rewrite ^(.*)$ /baseUrl/$1;
}

location ~ /baseUrl/ {
resolver 127.0.0.11 ipv6=off;
proxy_pass $arg_baseUrl$request_uri;
}

location ~ /hawtio {
proxy_pass http://p6core:8080;
}

location ~ /p6/vmstats {
proxy_pass http://p6core:8080;
}

location ~ / {
proxy_pass http://portalbucket.amalto.com;
}
}
13 changes: 0 additions & 13 deletions docker-compose/scripts/proxy_healthcheck.sh

This file was deleted.

0 comments on commit b7989d1

Please sign in to comment.