Docker Deployment
Containerized deployment of BISO Sites applications using Docker.
Docker Deployment
Both web and admin apps include Dockerfiles for containerized deployment.
When to choose Docker
Use Docker when you need to host the apps on your own infrastructure (student-union servers, cloud VMs, or temporary demo environments) and want predictable builds. If you deploy to Vercel or Netlify you can skip this section.
Deployment checklist
Build the images
Use docker build -t biso-web -f apps/web/Dockerfile . (and the admin/docs equivalents). Tag with the commit SHA for traceability.
Provision environment variables
Copy .env.local files or a secrets manager into /apps/*/.env.production. Reference Environment Variables for the canonical list.
Run containers or compose stack
Use docker run for one-off tests or docker compose up -d in production so all apps share the same network.
Smoke test + monitor logs
Visit each port (3000, 3001, 3002) and tail logs with docker logs -f <container>. Check Appwrite and Vipps integrations immediately after deployment.
Dockerfile Structure
# apps/web/Dockerfile
FROM oven/bun:1 as base
WORKDIR /usr/src/app
# Install dependencies
FROM base AS install
RUN mkdir -p /temp/prod
COPY package.json bun.lockb /temp/prod/
RUN cd /temp/prod && bun install --frozen-lockfile --production
# Build application
FROM base AS build
COPY --from=install /temp/prod/node_modules node_modules
COPY . .
RUN bun run build
# Production image
FROM base AS release
COPY --from=install /temp/prod/node_modules node_modules
COPY --from=build /usr/src/app/.next .next
COPY --from=build /usr/src/app/public public
COPY --from=build /usr/src/app/package.json .
EXPOSE 3000
CMD ["bun", "run", "start"]Building Images
# Build web app
docker build -t biso-web -f apps/web/Dockerfile .
# Build admin app
docker build -t biso-admin -f apps/admin/Dockerfile .Running Containers
# Run web app
docker run -p 3000:3000 \
-e NEXT_PUBLIC_APPWRITE_PROJECT_ID=... \
-e APPWRITE_API_KEY=... \
biso-web
# Run admin app
docker run -p 3001:3001 \
-e NEXT_PUBLIC_APPWRITE_PROJECT_ID=... \
-e APPWRITE_API_KEY=... \
biso-adminDocker Compose
# docker-compose.yml
version: '3.8'
services:
web:
build:
context: .
dockerfile: apps/web/Dockerfile
ports:
- "3000:3000"
env_file:
- apps/web/.env.local
restart: unless-stopped
admin:
build:
context: .
dockerfile: apps/admin/Dockerfile
ports:
- "3001:3001"
env_file:
- apps/admin/.env.local
restart: unless-stopped
docs:
build:
context: .
dockerfile: apps/docs/Dockerfile
ports:
- "3002:3002"
restart: unless-stoppedRun with:
docker-compose up -dThe Dockerfiles use multi-stage builds to minimize final image size by excluding build dependencies.
