This guide will walk you through setting up the system by building each part using Docker.
You can set up a MongoDB database using Docker. Refer to the official MongoDB documentation.
For GUI management, download MongoDB Compass.
Useful resources:
-
Create a Docker network for your app:
docker network create app-network
-
Run MongoDB:
mkdir -p data/test-change-streams docker run -d \ --name mongodb \ -v /data/test-change-streams:/data/db \ -p 27017:27017 \ --network app-network \ mongo:latest \ mongod --replSet test-change-streams --logpath /data/db/mongodb.log --dbpath /data/db --port 27017 docker exec -it mongodb mongosh --eval "rs.initiate()" docker exec -it mongodb mongosh --eval "rs.reconfig({_id: 'test-change-streams', members: [{ _id : 0, host : 'mongodb:27017'}]}, {force: true})" docker exec -it mongodb mongosh --eval "rs.status()"
-
Build the FastAPI Docker image:
docker build -t multilanguage_invoice_ocr-fastapi .
-
Run the backend container:
docker run -d --env-file .env \ -v $(pwd)/config:/app/config \ -v $(pwd)/src:/app/src \ -p 8149:8149 \ --network app-network \ multilanguage_invoice_ocr-fastapi:latest
-
Navigate to the frontend directory:
cd jwt-auth-frontend/
-
Build the frontend Docker image:
docker build -t jwt-auth-frontend .
-
Run the frontend container:
docker run -d \ --name jwt-frontend-container \ --network app-network \ -p 3000:3000 \ -v $(pwd)/src:/app/src \ jwt-auth-frontend
Follow the steps outlined in this guide to set up NGINX.
-
Navigate to the
nginx
directory:cd nginx
-
Run the NGINX container:
docker run -d \ --name nginx \ --network app-network \ -p 80:80 \ -v $(pwd)/nginx/nginx.conf.template:/etc/nginx/nginx.conf.template:ro \ -e CLIENT_MAX_BODY_SIZE=${CLIENT_MAX_BODY_SIZE} \ -e SERVER_IP=${SERVER_IP} \ nginx