Skip to content

Run backend and frontend as separate services #118

@mehiX

Description

@mehiX

At the moment both backend and frontend are running in the same container.

It would be great to have them separated. For example, docker-compose.yml would look like:

version: "3.8"
services:
  backend: 
    build: ./server
    depends_on:
    - db
    ports:
    - 8082:80
    environment:
      profile: prod
  
  frontend:
    build: 
      context: ./webapp
      args:
        profile: prod
        REACT_APP_API_URL: http://localhost:8082
    depends_on:
    - backend
    ports:
    - 8080:80
      
  db:
    image: mongo:6.0.3
    container_name: db
    environment:
      MONGO_INITDB_DATABASE: tech
    volumes:
      - ./init-db.js:/docker-entrypoint-initdb.d/init.js

Backend and frontend have their own Dockerfile and can be built and restarted independently.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions