This repository demonstrates how to containerize a full-stack application using Docker Compose. The project consists of two main services:
- Express API Service: A Node.js Express server that provides API endpoints and connects to a PostgreSQL database.
- React App: A front-end application built with React.
Both services are orchestrated with Docker Compose for easy setup and deployment.
- Docker (v20+ recommended)
- Docker Compose (v2+ recommended)
.
├── express-pg-server
│ ├── Dockerfile
│ ├── package.json
│ ├── index.js
│ └── ... (other API files)
├── react
│ ├── Dockerfile
│ ├── package.json
│ ├── public
│ ├── src
│ └── ... (other React files)
├── docker-compose.yaml
└── README.md
Before running the project, you must set up the required environment variables.
To start the containers, networks, images, and volumes, run:
docker compose up --build -dTo stop and remove the containers, networks, images, and volumes, run:
docker compose down --rmi all -v- Obsolete
versionfield:
Docker Compose v2+ no longer requires theversionfield indocker-compose.yaml. Remove it if you see warnings.
This project is licensed under the MIT License. See the LICENSE file for details.