-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Showing
3 changed files
with
131 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,94 @@ | ||
version: '3.8' | ||
|
||
services: | ||
app1: | ||
image: clivern/lynx:0.11.10 | ||
environment: | ||
APP_NAME: Lynx | ||
APP_PORT: 4001 | ||
APP_SECRET: koPmu7TJCwD8mttV9vgWUeU7iuu/zTPOR3sX4UalM9KkYEVGPfyi0PeTVzu1TT8C | ||
APP_HOST: localhost | ||
APP_HTTP_SCHEMA: http | ||
DB_USERNAME: root | ||
DB_PASSWORD: D1q9f0C2&PEW | ||
DB_HOSTNAME: db | ||
DB_DATABASE: lynx | ||
DB_PORT: 5432 | ||
DB_SSL: null | ||
DB_CA_CERTFILE_PATH: null | ||
MIX_ENV: prod | ||
command: sh -c "/app/bin/migrate && /app/bin/server" | ||
restart: unless-stopped | ||
depends_on: | ||
- db | ||
|
||
app2: | ||
image: clivern/lynx:0.11.10 | ||
environment: | ||
APP_NAME: Lynx | ||
APP_PORT: 4002 | ||
APP_SECRET: koPmu7TJCwD8mttV9vgWUeU7iuu/zTPOR3sX4UalM9KkYEVGPfyi0PeTVzu1TT8C | ||
APP_HOST: localhost | ||
APP_HTTP_SCHEMA: http | ||
DB_USERNAME: root | ||
DB_PASSWORD: D1q9f0C2&PEW | ||
DB_HOSTNAME: db | ||
DB_DATABASE: lynx | ||
DB_PORT: 5432 | ||
DB_SSL: null | ||
DB_CA_CERTFILE_PATH: null | ||
MIX_ENV: prod | ||
command: sh -c "/app/bin/migrate && /app/bin/server" | ||
restart: unless-stopped | ||
depends_on: | ||
- db | ||
|
||
app3: | ||
image: clivern/lynx:0.11.10 | ||
environment: | ||
APP_NAME: Lynx | ||
APP_PORT: 4003 | ||
APP_SECRET: koPmu7TJCwD8mttV9vgWUeU7iuu/zTPOR3sX4UalM9KkYEVGPfyi0PeTVzu1TT8C | ||
APP_HOST: localhost | ||
APP_HTTP_SCHEMA: http | ||
DB_USERNAME: root | ||
DB_PASSWORD: D1q9f0C2&PEW | ||
DB_HOSTNAME: db | ||
DB_DATABASE: lynx | ||
DB_PORT: 5432 | ||
DB_SSL: null | ||
DB_CA_CERTFILE_PATH: null | ||
MIX_ENV: prod | ||
command: sh -c "/app/bin/migrate && /app/bin/server" | ||
restart: unless-stopped | ||
depends_on: | ||
- db | ||
|
||
db: | ||
image: postgres:16.3 | ||
environment: | ||
POSTGRES_DB: lynx | ||
POSTGRES_USER: root | ||
POSTGRES_PASSWORD: D1q9f0C2&PEW | ||
restart: unless-stopped | ||
volumes: | ||
- db:/var/lib/postgresql/data | ||
|
||
nginx: | ||
image: nginx:1.25.4-alpine3.18 | ||
ports: | ||
- '80:80' | ||
healthcheck: | ||
test: ["CMD", "curl", "--fail", "http://localhost/_ready"] | ||
interval: 30s | ||
retries: 3 | ||
restart: unless-stopped | ||
volumes: | ||
- ./nginx.conf:/etc/nginx/nginx.conf | ||
- nginx_logs:/var/log/nginx | ||
|
||
volumes: | ||
db: | ||
driver: local | ||
nginx_logs: | ||
driver: local |
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
events { } | ||
|
||
http { | ||
upstream app_servers { | ||
# Default Algorithm is Round Robin | ||
server app1:4001; | ||
server app2:4002; | ||
server app3:4003; | ||
} | ||
|
||
server { | ||
listen 80; | ||
server_name lynx.sh; # Replace with your actual domain name | ||
|
||
location / { | ||
proxy_pass http://app_servers; | ||
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; | ||
} | ||
} | ||
} |