135 lines
2.7 KiB
YAML
135 lines
2.7 KiB
YAML
version: "3.3"
|
|
|
|
services:
|
|
|
|
nginx:
|
|
image: nginx:alpine
|
|
container_name: nginx
|
|
env_file: .env
|
|
depends_on:
|
|
- api
|
|
ports:
|
|
- 80:80
|
|
volumes:
|
|
- ./conf/nginx.conf:/etc/nginx/conf.d/default.conf
|
|
- ./frontend:/var/www/html
|
|
networks:
|
|
- pongNetwork
|
|
|
|
react_app:
|
|
image: node:latest
|
|
container_name: react_app
|
|
working_dir: /app
|
|
# depends_on:
|
|
# - nginx
|
|
ports:
|
|
- 8080:8080
|
|
volumes:
|
|
- ./react:/app
|
|
networks:
|
|
- pongNetwork
|
|
entrypoint: ["sh", "-c" , "npm install && npm run start:dev"]
|
|
|
|
|
|
api:
|
|
image: node:latest
|
|
container_name: api
|
|
working_dir: /app
|
|
ports:
|
|
- 3000:3000
|
|
env_file: .env
|
|
depends_on:
|
|
- postgresql
|
|
networks:
|
|
- pongNetwork
|
|
volumes:
|
|
- ./api:/app
|
|
entrypoint: ["sh", "-c" , "npm install && npm run start:dev"]
|
|
|
|
# backend:
|
|
# # image: node:latest
|
|
# build:
|
|
# context : ./
|
|
# dockerfile: ./dockerfiles/Dockerfile.backEnd
|
|
# container_name: backend
|
|
# ports:
|
|
# - 3000:3000
|
|
# env_file: .env
|
|
# depends_on:
|
|
# - postgresql
|
|
# networks:
|
|
# - pongNetwork
|
|
# # working_dir: /app
|
|
# # volumes:
|
|
# # - ./backend:/app
|
|
# # entrypoint: ["sh", "-c" , "npm install && ls && ls dist && npm run build && npm run start"]
|
|
# # entrypoint: ["/bin/sh", "-c" , "npm install && npm run start:dev "]
|
|
|
|
|
|
postgresql:
|
|
image: postgres:14.1-alpine
|
|
restart: unless-stopped
|
|
container_name: postgresql
|
|
environment:
|
|
- POSTGRES_USER=postgres
|
|
- POSTGRES_PASSWORD=postgres
|
|
ports:
|
|
- 5432:5432
|
|
volumes:
|
|
- db:/var/lib/postgresql/data
|
|
- ./conf/init.sql:/docker-entrypoint-initdb.d/create_tables.sql
|
|
networks:
|
|
- pongNetwork
|
|
|
|
pong:
|
|
image: node:latest
|
|
container_name: pong
|
|
working_dir: /app
|
|
ports:
|
|
- 4000:4000
|
|
env_file: .env
|
|
networks:
|
|
- pongNetwork
|
|
volumes:
|
|
- ./pong:/app
|
|
entrypoint: ["sh", "-c" , "npm install && npm run start:dev"]
|
|
|
|
# chat:
|
|
# image: node:latest
|
|
# container_name: chat
|
|
# working_dir: /app
|
|
# ports:
|
|
# - 4001:4001
|
|
# env_file: .env
|
|
# networks:
|
|
# - pongNetwork
|
|
# volumes:
|
|
# - ./chat:/app
|
|
# entrypoint: ["sh", "-c" , "npm install && npm run start:dev"]
|
|
|
|
|
|
networks:
|
|
pongNetwork:
|
|
driver: bridge
|
|
|
|
volumes:
|
|
front_files:
|
|
driver: local
|
|
driver_opts:
|
|
type: none
|
|
o: 'bind'
|
|
device: '/frontend'
|
|
dbdata:
|
|
driver: local
|
|
driver_opts:
|
|
type: none
|
|
o: 'bind'
|
|
device: '/home/apommier/data/mariadb'
|
|
back:
|
|
driver: local
|
|
driver_opts:
|
|
type: none
|
|
o: 'bind'
|
|
device: '/backend'
|
|
db:
|
|
driver: local |