StayFit is a web application for fitness & nutrition.
GitHub Repository: https://github.com/AndreiVoicu26/StayFit
You need to:
- Install Docker Desktop and open it to start the Docker Engine.
- Install Git to clone the project (optional).
You have two options here:
- Download the project using
Download ZIP
option and extract it into a new folder.
or - Clone the project into a new folder using Git:
git clone https://github.com/AndreiVoicu26/StayFit.git
- Open the project in a terminal and navigate at the level of the
docker-compose.yml
file.
- Create a new folder and inside the folder create a new YAML file named
docker-compose.yml
, with the following content:
version: "3.8"
services:
db:
image: postgres:latest
ports:
- "5432:5432"
environment:
- POSTGRES_USER=andrei
- POSTGRES_PASSWORD=andrei26
- POSTGRES_DB=stayfitDB
volumes:
- db-data:/var/lib/postgresql/data
spring-boot-app:
image: andreivoicu26/stayfit:spring-boot-app
ports:
- "8080:8080"
depends_on:
- db
environment:
- SPRING_DATASOURCE_URL=jdbc:postgresql://db:5432/stayfitDB
- SPRING_DATASOURCE_USERNAME=andrei
- SPRING_DATASOURCE_PASSWORD=andrei26
react-app:
image: andreivoicu26/stayfit:react-app
ports:
- "3000:80"
volumes:
db-data:
- Open a terminal and navigate at the level of the
docker-compose.yml
file. - Login into the private Docker registry:
docker login -u andreivoicu26
- At the password prompt, enter the personal access token:
dckr_pat_dIks4V_JZwMUD_qDEAEEUEtAEbE
- Build / Pull the Docker images, create and start the containers based on the
docker-compose.yml
file using Docker Compose:
docker-compose up --build -d
- Check if the containers are running in the Docker Desktop app.
- Open a browser and access the StayFit app at
http://localhost:3000
- Enjoy!