This project consists of a backend, frontend, and a PostgreSQL database, orchestrated using Docker Compose. The services are connected through a custom Docker network (bio_net) to ensure smooth communication.
- Environment File:
./backend/.env - Build Context:
./backend - Dockerfile:
./Dockerfile - Ports:
- Exposed on
localhost:8000
- Exposed on
- Volumes:
- Maps the local directory
./backendto/usr/src/appinside the container.
- Maps the local directory
- Dependencies:
- Depends on the
dbservice.
- Depends on the
- Network:
- Connected to
bio_net.
- Connected to
- Environment File:
./frontend/.env - Build Context:
./frontend - Dockerfile:
./Dockerfile - Ports:
- Exposed on
localhost:3000
- Exposed on
- Volumes:
- Maps the local directory
./frontendto/usr/src/appinside the container.
- Maps the local directory
- Network:
- Connected to
bio_net.
- Connected to
- Image:
postgres:13.1-alpine - Environment Variables:
POSTGRES_DB:bioPOSTGRES_USER:adminPOSTGRES_PASSWORD:12345
- Volumes:
- Stores persistent data in
bio_datavolume, mapped to/var/lib/postgresql/data/.
- Stores persistent data in
- Ports:
- Exposed on
localhost:5432.
- Exposed on
- Network:
- Connected to
bio_net.
- Connected to
- Type: Bridge
- Connects all the services to facilitate communication.
- bio_data: Persistent storage for PostgreSQL data.
- media: (Unused currently, but defined for future use.)
- Install Docker and Docker Compose on your system.
- Clone the repository:
git clone <repository-url> cd <repository-name>
- Create .env files for the backend and frontend services in their respective directories.
- Start the project using Docker Compose
docker-compose up --build
This command will build the images and start the services. 4. Access the application:
- Frontend:
http://localhost:3000 - Backend:
http://localhost:8000 - Database:
http://localhost:5432
DB_NAME: Database nameDB_USER: Database userDB_PASSWORD: Database passwordDB_HOST: Database hostPOSTDB_PORTGRES_PORT: Database portSECRET_KEY: Secret keyJWT_SECRET_KEY: Secret key for JWTDEBUG: True or FalseALLOWED_HOSTS: 127.0.0.1 0.0.0.0
BACKEND_API_URL=http://0.0.0.0:8000/NEXTAUTH_SECRET=secretNEXTAUTH_URL=http://localhost:3000/