I have a potentially dumb question. Bear with me, I may sound stupid but this is my first time doing this crap and I would appreciate your help. I know you don't get anything from helping me, so thank you in advance. I have a Nuxt SSR and a Laravel API. Laravel uses serversideup's image which has its own fpm and nginx configuration. Now I need Nginx on host (so outside of docker containers) to make a proxy or something so the user communicates with Nuxt and Nuxt communicates with the api (I have set my domains and I have set my certificate). Now in my Nginx config do I use the localhost for proxying or the container names? And what else should I know for this? This has been a pain tbh
This is my doocker-compose.prod for these 2 containers :
version: '3.9'
services:
mysql:
image: mysql:8.0
container_name: sql
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: mydb
MYSQL_USER: myuser
MYSQL_PASSWORD: somepassword
volumes:
- mysql_data:/var/lib/mysql
networks:
- app-net
api:
build:
context: ./laravel-api
dockerfile: Dockerfile
container_name: api
restart: unless-stopped
env_file: ./laravel-api/.env.prod
depends_on:
- mysql
ports:
- "127.0.0.1:8080:8080"
networks:
- app-net
nuxt:
build:
context: ./nuxt-app
dockerfile: Dockerfile.prod
target: prod
container_name: nuxt
restart: unless-stopped
environment:
- NODE_ENV=production
ports:
- "127.0.0.1:3000:3000"
networks:
- app-net
networks:
app-net:
driver: bridge
volumes:
mysql_data: