Deploying with Docker
You can deploy any BCMS-powered project using Docker by creating a simple Dockerfile
and passing your environment variables at runtime.
Example Dockerfile
# Use Node.js base image FROM node:20 # Create app directory WORKDIR /app # Copy project files COPY . . # Install dependencies RUN npm install # Build project (optional for static sites) RUN npm run build # Expose port EXPOSE 3000 # Start app CMD ["npm", "start"]
Environment variables
Make sure to pass your BCMS environment variables:
NEXT_PUBLIC_BCMS_ORG_ID
NEXT_PUBLIC_BCMS_INSTANCE_ID
NEXT_PUBLIC_BCMS_API_KEY_ID
NEXT_PUBLIC_BCMS_API_KEY_SECRET
You can add these using a .env
file or directly in your docker run
command:
docker run -p 3000:3000 \ -e NEXT_PUBLIC_BCMS_ORG_ID=your-org-id \ -e NEXT_PUBLIC_BCMS_INSTANCE_ID=your-instance-id \ -e NEXT_PUBLIC_BCMS_API_KEY_ID=your-key-id \ -e NEXT_PUBLIC_BCMS_API_KEY_SECRET=your-key-secret \ your-image-name
Notes
Adjust the port if your framework uses a different one.
For static sites, consider serving with
serve
,nginx
, or another static file server.This works with any frontend framework compatible with BCMS.