Skip to content

Commit

Permalink
adapting docker compose nas. preparing for nginx container
Browse files Browse the repository at this point in the history
  • Loading branch information
pdelebarre committed Oct 30, 2024
1 parent 44976b5 commit 5c00095
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 40 deletions.
Binary file modified .DS_Store
Binary file not shown.
38 changes: 13 additions & 25 deletions docker-compose.nas.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,23 @@
services:
frontend:
container_name: frontend
build:
context: ./frontend
image: pdelebarre/guitar-tutorial-app-frontend
# :${BUILD_ENV:-dev}
environment:
- GUITARTUTORIALAPP_API_BASE_URL=http://backend
- GUITARTUTORIALAPP_API_PORT=8080
nginx:
image: nginx:latest
container_name: nginx-proxy
restart: always
ports:
- "3000:80"
- "3050:80"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
depends_on:
- backend
networks:
- guitartuto-network
- frontend

frontend:
container_name: frontend
image: pdelebarre/guitar-tutorial-app-frontend

backend:
container_name: backend
build:
context: ./backend
dockerfile: Dockerfile
image: pdelebarre/guitar-tutorial-app-backend
ports:
- "8080:8080"
environment:
TUTORIALS_PATH: /app/tutorials
SPRING_PROFILES_ACTIVE: prod
Expand All @@ -31,10 +26,9 @@ services:
SPRING_DATASOURCE_PASSWORD: mypassword
volumes:
- /volume1/docker/guitar-tutorial/tutorials:/app/tutorials
networks:
- guitartuto-network
depends_on:
- postgres
restart: unless-stopped

postgres:
image: postgres:17-alpine
Expand All @@ -47,17 +41,11 @@ services:
- "5433:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- guitartuto-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U myuser -d guitardb"]
interval: 10s
retries: 5
start_period: 5s

networks:
guitartuto-network:
driver: bridge

volumes:
postgres_data:
15 changes: 0 additions & 15 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3.8"

services:
nginx:
image: nginx:latest
Expand All @@ -9,8 +7,6 @@ services:
- "3050:80"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
# networks:
# - guitartuto-network
depends_on:
- backend
- frontend
Expand All @@ -25,21 +21,10 @@ services:
SPRING_PROFILES_ACTIVE: dev
volumes:
- /Volumes/LaCie/dev/guitar-tutorial-app/tutorials:/app/tutorials
# networks:
# - guitartuto-network
restart: unless-stopped

frontend:
stdin_open: true
image: pdelebarre/guitar-tutorial-app-frontend
container_name: frontend
# environment:
# TUTO_API_URL: http://nginx/api # Set API URL to go through Nginx
# ports:
# - "3000:80" # Uncomment if you want direct access to frontend on port 3000
# networks:
# - guitartuto-network

# networks:
# guitartuto-network:
# driver: bridge
2 changes: 2 additions & 0 deletions nginx/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FROM nginx:latest
COPY ./default.conf /etc/nginx/conf.d/default.conf

0 comments on commit 5c00095

Please sign in to comment.