An open API service indexing awesome lists of open source software.

https://github.com/santilapi13/docker_compose_fullstack

Simple fullstack application using 3 Docker 🐳 containers for: CouchDB, React frontend and Express backend.
https://github.com/santilapi13/docker_compose_fullstack

couchdb docker docker-compose express fullstack-development

Last synced: 2 months ago
JSON representation

Simple fullstack application using 3 Docker 🐳 containers for: CouchDB, React frontend and Express backend.

Awesome Lists containing this project

README

          

# Fullstack application with Docker Compose 🐳
This is a fullstack application with a React frontend, an Express and Node.js backend and a CouchDB database.
## Frontend βš›οΈ
The frontend is a simple web page that displays a list of characters from films and an input field used to send new characters to the database. It's located in the "frontend_container" directory. The Alpine Linux image is used to build the frontend container from the Dockerfile.

The container port 8080 is mapped to the host port 3001: http://localhost:3001
## Backend 🟒
The backend is a REST API that serves the list of characters to the frontend after fetching them from the database. It also receives new characters from the frontend and sends them to the database. The backend is constantly loading random characters to the database. It's located in the "backend_container" directory. The Node image is used to build the backend container from the Dockerfile.

The container port 3000 is mapped to the host port 3000, in the /data endpoint: http://localhost:3000/data
## Database πŸ›‹οΈ
The database is a CouchDB instance that stores the characters and persists in the "dbdata" volume after the container is stopped. The container is loaded directly from the official CouchDB image.

The container port 5984 is mapped to the host port 5984 http://localhost:5984/_utils

# Members
- Santiago Lapiana
- Wenceslao Ávalos

# Requirements
Docker and Docker Compose installed on your machine (https://docs.docker.com/engine/install/)

# How to run
1. Clone the repository with `git clone https://github.com/santilapi13/Docker_Compose_Fullstack.git`
2. Navigate to the project directory with `cd Docker_Compose_Fullstack`
3. Set environment variables in a `.env` file, in the same directory as `.env.example` file.
```
DB_URL = 'http://couchdb_container:5984/data'
COUCH_USER = 'admin'
COUCH_PASS = 'admin'
```
5. Run `docker-compose up --build` to build and start the containers
6. Open your browser and go to http://localhost:3001 to see the frontend