-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add docker compose for alternative way to deploy
- Loading branch information
1 parent
7278b89
commit ba08db2
Showing
2 changed files
with
108 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
version: '3.8' | ||
|
||
services: | ||
api: | ||
build: | ||
context: . | ||
dockerfile: api.Dockerfile | ||
networks: | ||
- app-network | ||
depends_on: | ||
- postgres | ||
- redis | ||
environment: | ||
REDIS_HOST: redis | ||
REDIS_PORT: 6379 | ||
DB_HOST: postgres | ||
DB_PORT: 5432 | ||
DB_USERNAME: your_postgres_user | ||
DB_PASSWORD: your_postgres_password | ||
DB_DATABASE: your_postgres_db | ||
|
||
desktop: | ||
build: | ||
context: . | ||
dockerfile: desktop.Dockerfile | ||
networks: | ||
- app-network | ||
|
||
mobile: | ||
build: | ||
context: . | ||
dockerfile: mobile.Dockerfile | ||
networks: | ||
- app-network | ||
|
||
nginx: | ||
image: nginx:latest | ||
ports: | ||
- '80:80' | ||
volumes: | ||
- ./nginx-compose.conf:/etc/nginx/conf.d/default.conf | ||
depends_on: | ||
- api | ||
- desktop | ||
- mobile | ||
networks: | ||
- app-network | ||
|
||
postgres: | ||
image: postgres:13 | ||
environment: | ||
POSTGRES_USER: your_postgres_user | ||
POSTGRES_PASSWORD: your_postgres_password | ||
POSTGRES_DB: your_postgres_db | ||
volumes: | ||
- postgres_data:/var/lib/postgresql/data | ||
networks: | ||
- app-network | ||
|
||
redis: | ||
image: redis:latest | ||
networks: | ||
- app-network | ||
|
||
networks: | ||
app-network: | ||
driver: bridge | ||
|
||
volumes: | ||
postgres_data: |
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,38 @@ | ||
server { | ||
listen 80; | ||
server_name api.attendance.koraykural.com; | ||
|
||
location / { | ||
proxy_pass http://api:3333/; | ||
proxy_set_header Host $host; | ||
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; | ||
} | ||
} | ||
|
||
server { | ||
listen 80; | ||
server_name attendance.koraykural.com; | ||
|
||
location / { | ||
proxy_pass http://desktop:80/; | ||
proxy_set_header Host $host; | ||
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; | ||
} | ||
} | ||
|
||
server { | ||
listen 80; | ||
server_name mobile.attendance.koraykural.com; | ||
|
||
location / { | ||
proxy_pass http://mobile:80/; | ||
proxy_set_header Host $host; | ||
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; | ||
} | ||
} |