version: "3.3" services: nginx: build: context : ./ dockerfile: ./dockerfiles/Dockerfile.nginx container_name: nginx env_file: .env depends_on: - backend ports: - 80:80 # - 443:443 volumes: - ./frontend:/var/www/html # restart: unless-stopped networks: - pongNetwork backend: image: node:latest build: context : ./ dockerfile: ./dockerfiles/Dockerfile.backEnd container_name: backend ports: - 3000:3000 env_file: .env # volumes: # - ./backend:/usr/src/app/ depends_on: - postgresql # entrypoint: ["/bin/sh", "-c" , "npm install && npm run start:dev"] # restart: unless-stopped networks: - pongNetwork postgresql: image: postgres:14.1-alpine restart: unless-stopped environment: - POSTGRES_USER=postgres - POSTGRES_PASSWORD=postgres ports: - 5432:5432 volumes: - db:/var/lib/postgresql/data - ./database/init.sql:/docker-entrypoint-initdb.d/create_tables.sql networks: - pongNetwork # postgresql: # build: #./dockerfiles/Dockerfile.PostgreSQL # context : ./ # dockerfile: ./dockerfiles/Dockerfile.PostgreSQL # container_name: postgreDB # #image: mariadb:homemade # ports: # - 5432:5432 # # - ${POSTGRES_PORT}:${POSTGRES_PORT} # env_file: .env # # environment: # # - POSTGRES_USER:kinou # # - POSTGRES_PASSWORD:pass # # - POSTGRES_DB:postgreDB # # - POSTGRES_ROOT_PASSWORD:pass # # - POSTGRES_HOST:localhost # # - name:value # #volumes: # # - dbdata:/var/lib/mysql # # networks: # # - pongNetwork # restart: unless-stopped 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 # version: "3.3" # services: # backend: # build: # context: ./dockerfiles # dockerfile: Dockerfile.backEnd # ports: # - "3000:3000" # nginx: # restart: always # build: # context: ./dockerfiles # dockerfile: Dockerfile.nginx # ports: # - "80:80"