Docker - IP-2025/waves-of-the-fallen GitHub Wiki
This project uses Docker to containerize both the backend and the database. Follow the steps below to get the application up and running in your local environment.
Prerequisites
- Ensure Docker is installed and running on your system.
- Installation
- Recommended: Docker Compose (usually included with Docker Desktop).
To verify Docker is installed, run:
docker --version
docker compose version
Docker Compose
- The Docker images for both the backend and database are built and managed using Docker Compose.
- For Docker Compose to work correctly, a .env file is required in the backend/ directory. This file contains important environment variables such as the database URL, ports, and secrets.
[!CAUTION] Never commit a
.env
file.
- The repository includes a .env-template file that can be used as a starting point.
# Navigate to the backend directory
cd backend
# Copy the template to create your .env file
cp .env-template .env
- to start the docker containers run in the
backend/
dir this command:
docker compose up --build
- after the containers have started correctly you can check them in docker-desktop or:
docker ps
Docker Containers
The docker compose will create 3 docker containers:
- For the nodejs express backend
- For the postgreSQL databse
- For pgamdin (tool to look into dbs)
PgAdmin
- pgAdmin is a web-based tool to manage PostgreSQL databases.
- Then open your browser at http://localhost:5050/ and log in.
- the login information can be adjusted and found inside of the
.env
- after logging in create a connection to the db by:
- pressing on
Add new Server
- give the database a name in the general tab
- in the connections tab enter
Hostname
,Password
andUsername
all these values can be found in the.env