Skip to content

Docker project to containerize a React frontend, Node.js Express API, and PostgreSQL database using Docker Compose for seamless development and deployment.

Notifications You must be signed in to change notification settings

Calvinphuah/docker-postgres-react-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Express API & React App with PostgreSQL (Dockerized)

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.

Table of Contents

Prerequisites

  • Docker (v20+ recommended)
  • Docker Compose (v2+ recommended)

Project Structure

.
├── 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

Setting Up Environment Variables

Before running the project, you must set up the required environment variables.

Starting the Services

To start the containers, networks, images, and volumes, run:

docker compose up --build -d

Stopping the Services

To stop and remove the containers, networks, images, and volumes, run:

docker compose down --rmi all -v

Notes

  • Obsolete version field:
    Docker Compose v2+ no longer requires the version field in docker-compose.yaml. Remove it if you see warnings.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

Docker project to containerize a React frontend, Node.js Express API, and PostgreSQL database using Docker Compose for seamless development and deployment.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published