Co-Founder is a web application that matches potential Co-Founders. It consists of a frontend and a backend service. The frontend is implemented using Node.js, and the backend is built with Python. Docker Compose is used to manage and run these services, making it easy to scale and deploy.
Before you begin, please ensure you have installed the following:
To run the project using Docker Compose, follow these steps:
- Open a terminal and navigate to the project's root directory.
- Run the following command to build and start the services:
docker-compose up --build
- The frontend service will be accessible at
http://localhost:3000
and the backend service will be available athttp://localhost:5001
.
Here are the steps to run the backend service independently:
- Navigate to the
backend/api
directory. - Install the necessary Python packages by running the following command in the
/project/backend
directory:
pip install -r requirements.txt
- Start the backend service with:
python3 run.py
The backend service will now run on port 5001.
The Dockerfile for the backend service is:
FROM python:3.8-slim-buster
WORKDIR /app
COPY requirements.txt ./
RUN pip install -r requirements.txt
COPY . .
EXPOSE 5001
CMD ["python3", "./api/run.py"]
Here are the steps to run the frontend service independently:
- Navigate to the
frontend
folder. - Install the necessary Node.js packages with:
npm install
- After the installation, start the frontend service with:
npm start
The frontend service will now run on port 3000.
The Dockerfile for the frontend service is:
FROM node:14-alpine
WORKDIR /app
COPY package.json ./
RUN npm install
COPY . .
RUN npm run build
EXPOSE 3000
CMD ["npm", "start"]
The Docker Compose file defines the services (frontend and backend), their build contexts, Dockerfiles, exposed ports, and dependencies.
version: "3"
services:
frontend:
image: my-frontend
build:
context: ./frontend
dockerfile: Dockerfile
ports:
- "3000:3000"
depends_on:
- backend
backend:
image: my-backend
build:
context: ./backend
dockerfile: Dockerfile
ports:
- "5001:5001"
For more information or any queries, please contact me at <hello@mustafayasin.com>
.
This project is licensed under MIT License
.