This project uses Docker Compose to set up a multi-container environment for a web application. The services include a frontend, backend, database, and various workers.
- Docker
- Docker Compose
- Cloudflare account
Create a .env.cloudflared file with the following environment variables:
POSTGRES_NAME=postgres
POSTGRES_DB=postgres
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_HOST=ccdb
POSTGRES_PORT=5432
REDIS_HOST=ccredis
REDIS_PORT=6379
SECRET_KEY=testth!_q_0)r9_8n0gkey62u!(xwr-u0ys2z*hntinsecure
CORS_ORIGIN_WHITELIST=http://localhost,http://localhost:4200
CSRF_TRUSTED_ORIGINS=http://localhost,http://localhost:4200
PROTOCOLS_IO_ACCESS_TOKEN=
ALLOWED_HOSTS=localhost,localhost:4200,localhost:8001
DEBUG=False
USE_COTURN=False
USE_LLM=False
USE_WHISPER=False
USE_OCR=False
ALLOW_OVERLAP_BOOKINGS=True
FRONTEND_URL=http://localhost:4200The above variables are the default values, please change them according to your needs.
- Add the
TUNNEL_TOKENfor the supposed cloudflare tunnel in the.env.cloudflaredfile. - Replace the
CORS_ORIGIN_WHITELISTandCSRF_TRUSTED_ORIGINSwith the hostname and homepage urls of your tunnel. - Replace the
ALLOWED_HOSTSwith the hostnames of your tunnel. - Replace the
FRONTEND_URLwith the homepage url of your tunnel. - Replace the
USE_COTURN(webRTC experimental),USE_LLM(protocol summary),USE_WHISPER(transcription), andUSE_OCR(text recognition) withTrueorFalsedepending on your needs. - Replace the
ALLOW_OVERLAP_BOOKINGSwithTrueorFalseif you would like to allow overlapping booking of instrument.
- ccfrontend: The frontend service built from
Dockerfile-frontend. - cccloudflared: The Cloudflare tunnel service.
- ccnginx: The Nginx service built from
Dockerfile-nginx-demowhich use the nginx config filenginx-cupcake-demo.conf.- The
nginx-cupcake-demo.confis found in thenginx-confdirectory, please change the hostnamecupcake.proteo.infoto the hostname of your tunnel.
- The
- ssl: The SSL service built from
Dockerfile-ssl. This is mostly for local testing since the ssl will mostly be from cloudflare. - cc: The main backend service built from
Dockerfile. - ccdocx: The document export worker service built from
Dockerfile-export-worker. - ccimport: The data import worker service built from
Dockerfile-import-data-worker. - ccworker: The transcription worker service built from
Dockerfile-transcribe-worker. Optional service if you are not using transcription. - ccocr: The OCR worker service built from
Dockerfile-ocr. Optional service if you are not using OCR. - ccdb: The PostgreSQL database service.
- ccredis: The Redis service built from
Dockerfile-redis. - ccllama: The Llama worker service built from
Dockerfile-llama-worker. Optional service if you are not using Llama.
- ssl: Stores SSL certificates.
- ./media: Mounted to
/app/media/in various services. - ./staticfiles: Mounted to
/static/in theccnginxservice. - ./data2: Mounted to
/var/lib/postgresql/datain theccdbservice.
- cc-net: The custom network for all services.
-
Clone the repository.
-
Ensure you have Docker and Docker Compose installed.
-
Create a
.env.cloudflaredfile with the necessary environment variables (refer to.envfile and please addTUNNEL_TOKENfor the supposed cloudflare tunnel). -
Build and start the services:
docker-compose -f docker-compose.cloudflared.demo.yml up --build
-
Access the application via cloudflare tunnel.
- .env.cloudflared: Contains environment variables for the Cloudflare tunnel and other services.
- ccnginx: Exposes ports
80and443. - cc: Exposes port
8001. - ccdb: Exposes port
5433. - ccredis: Exposes port
6380.
- Ensure that the paths in the
volumessection of thedocker-compose.cloudflared.demo.ymlfile are correct and accessible. - The
ccnginxservice uses SSL certificates stored in thesslvolume.
This project is licensed under the MIT License.