Hub
Advanced
Build from source

Build from source

System requirements:

  • Git
  • Docker
  • Docker Compose

Build docker images

Clone the repository

git clone https://github.com/ZingerLittleBee/server_bee-backend.git

Modify the configuration file

Switch to the working directory

cd server_bee-backend/docker/

Undo the following comments

# build:
#   context: ../
#   dockerfile: docker/Dockerfile.hub

Full docker-compose.yml after modification as follows:

docker-compose.yml
version: '3'
 
services:
caddy:
image: caddy:2-alpine
container_name: serverbee-caddy
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
mongo:
image: mongo
container_name: serverbee-mongo
restart: always
environment:
- MONGO_INITDB_ROOT_USERNAME=${MONGO_INITDB_ROOT_USERNAME}
- MONGO_INITDB_ROOT_PASSWORD=${MONGO_INITDB_ROOT_PASSWORD}
hub:
build:
context: ../
dockerfile: docker/Dockerfile.hub
image: zingerbee/serverhub:latest
container_name: serverhub
restart: unless-stopped
# volumes:
#   - ../packages/db/prisma/serverhub.db:/app/serverhub.db
environment:
- DATABASE_URL=${DATABASE_URL}
- MONGODB_URI=${MONGODB_URI}
- NEXTAUTH_SECRET=${NEXTAUTH_SECRET}
- NEXTAUTH_URL=${NEXTAUTH_URL}
- SERVER_JWT_SECRET=${SERVER_JWT_SECRET}
depends_on:
- mongo
interactor:
build:
context: ../
dockerfile: docker/Dockerfile.interactor
image: zingerbee/serverbee-interactor:latest
container_name: serverbee-interactor
restart: unless-stopped
environment:
- RUST_LOG=${RUST_LOG}
- MONGODB_URI=${MONGODB_URI}
depends_on:
- mongo
recorder:
build:
context: ../
dockerfile: docker/Dockerfile.recorder
image: zingerbee/serverbee-recorder:latest
container_name: serverbee-recorder
restart: unless-stopped
environment:
- RUST_LOG=${RUST_LOG}
- SERVER_JWT_SECRET=${SERVER_JWT_SECRET}
- MONGODB_URI=${MONGODB_URI}
depends_on:
- mongo
web:
build:
context: ../
dockerfile: docker/Dockerfile.web
image: zingerbee/serverbee-web:latest
container_name: serverbee-web
restart: unless-stopped
command: [ "-r", "-u", "$SERVER_URL", "-s", "$SERVER_TOKEN" ]
ports:
- "9527:9527"
environment:
- SERVER_URL=${SERVER_URL}
- SERVER_TOKEN=${SERVER_TOKEN}
depends_on:
- recorder

Run build

docker-compose up -d