-
-
Notifications
You must be signed in to change notification settings - Fork 506
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8ecd6b4
commit 01615b9
Showing
3 changed files
with
61 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,54 @@ | ||
version: '3' | ||
version: "3.8" | ||
services: | ||
helpdesk-webapi: | ||
nginx: | ||
restart: always | ||
image: nginx:alpine | ||
ports: | ||
- 8089:80 | ||
volumes: | ||
- ./nginx.conf:/etc/nginx/conf.d/default.conf | ||
depends_on: | ||
- backend | ||
|
||
backend: | ||
build: | ||
dockerfile: Dockerfile | ||
context: . | ||
args: | ||
project_name: Helpdesk.Api | ||
run_codegen: true | ||
deploy: | ||
replicas: 3 | ||
networks: | ||
- loadbalancing | ||
# ports: | ||
# - "5248:5248" | ||
depends_on: | ||
- postgres | ||
postgres: | ||
condition: service_healthy | ||
# network_mode: "host" | ||
restart: always | ||
|
||
nginx: | ||
image: nginx | ||
volumes: | ||
- ./nginx.conf:/etc/nginx/conf.d/default.conf | ||
ports: | ||
- "80:80" | ||
networks: | ||
- loadbalancing | ||
depends_on: | ||
- helpdesk-webapi | ||
# nginx: | ||
# image: nginx:alpine | ||
# volumes: | ||
# - ./nginx/default.conf:/etc/nginx/conf.d/default.conf | ||
# depends_on: | ||
# - backend | ||
# ports: | ||
# - "4000:80" | ||
# # network_mode: "host" | ||
|
||
postgres: | ||
image: postgres:15.1-alpine | ||
container_name: postgres | ||
healthcheck: | ||
test: ["CMD-SHELL", "pg_isready -U postgres"] | ||
interval: 5s | ||
timeout: 5s | ||
retries: 5 | ||
environment: | ||
- POSTGRES_DB=postgres | ||
- POSTGRES_PASSWORD=Password12! | ||
ports: | ||
- "5432:5432" | ||
networks: | ||
- loadbalancing | ||
|
||
|
||
# nginx: | ||
# build: ../nginx | ||
# container_name: nginx | ||
# ports: | ||
# - "80:80" | ||
# networks: | ||
# - loadbalancing | ||
# depends_on: | ||
# - helpdesk-webapi | ||
# network_mode: "host" | ||
|
||
networks: | ||
loadbalancing: | ||
# networks: | ||
# loadbalancing: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,18 @@ | ||
upstream helpdesk-webapi { | ||
server helpdesk-webapi:5248; | ||
map $http_connection $connection_upgrade { | ||
"~*Upgrade" $http_connection; | ||
default keep-alive; | ||
} | ||
|
||
server { | ||
# listen 80; | ||
# | ||
# resolver 127.0.0.11 valid=5s; | ||
# | ||
# include /etc/nginx/mime.types; | ||
# | ||
# location / { | ||
# proxy_pass http://helpdesk-webapi/; | ||
# } | ||
# | ||
|
||
# listen 80 default_server; | ||
# | ||
# location / { | ||
# proxy_pass http://helpdesk-webapi/; | ||
# proxy_http_version 1.1; | ||
# proxy_set_header Upgrade $http_upgrade; | ||
# proxy_set_header Connection keep-alive; | ||
# proxy_set_header Host $host; | ||
# proxy_cache_bypass $http_upgrade; | ||
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
# proxy_set_header X-Forwarded-Proto $scheme; | ||
# } | ||
|
||
listen 80; | ||
server_name localhost; | ||
location / { | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
proxy_set_header Host $http_host; | ||
proxy_set_header X-NginX-Proxy true; | ||
|
||
proxy_redirect off; | ||
proxy_pass http://myserver; | ||
} | ||
listen 80; | ||
location / { | ||
proxy_pass http://backend:5248/; | ||
proxy_http_version 1.1; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection $connection_upgrade; | ||
proxy_set_header Host $host; | ||
proxy_cache_bypass $http_upgrade; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
} | ||
} |