Contents
Install via Dockerfile
Operational has a Dockerfile you install locally or on your server.
Alternatives we have ready-to-go images served via Github Registry hub.
Before we jump in, you’ll need to have a mysql connection string ready. If you’re using a service like Coolify, Dokploy or something similar, you can easily set this up inside their ui.
For local installations, you can use MAMP or something similar.
Step 1. Install Docker
For local installations, you can install Docker desktop from here.
On your VPS server, you’ll need to install docker via the command line.
Step 2. Pull the docker image
We have prebuild Docker images available at https://github.com/operational-co/operational.co/pkgs/container/operational.co
Just run docker pull ghcr.io/operational-co/operational.co:latest
and this will pull the latest Operational.co image.
Step 3. Configure ports & env
Ports
Ops’s dockerfile will require 2 ports. One for the frontend, other for the backend. You can pass ports via the -p switch.
Env vars
You’ll need to pass the DATABASE_URL
env as a bare minimum.
Here’s a basic example with ports and env vars:
docker run -d \
-p 80:80 \
-p 4337:4337 \
-e DATABASE_URL="mysql://root:password@127.0.0.1/operational"
CopyNote that the backslashes are for breaking the command up into multiple lines.
Complete example
This example has everything you need for a proper production ready deployment
docker run -d \
-p 80:80 \
-p 4337:4337 \
-e DATABASE_URL="mysql://root:qKz7y26Q2wp3@49.13.149.99:9009/operational-staging" \
-e VITE_API_URL="http://localhost:4337" \
-e APP_URL="http://localhost" \
-e VAPID_EMAIL="mailto:your-email@example.com" \
-e VAPID_PUBLIC_KEY="" \
-e VAPID_PRIVATE_KEY="" \
-e RESEND="your-resend-key" \
-e PORT=2000 \
-e SECRET="your-secret" \
-e ADMIN_EMAIL="shashwat.amin@yahoo.com" \
-e REMOVE_EVENTS_AT="120" \
-e REMOVE_TEST_EVENTS_AT="7" \
-e CORS="" \
ops-test
Copy- DATABASE_URL: mysql connection string
- VITE_API_URL: url of the backend.
- APP_URL: url of the frontend.
- VAPID_EMAIL: optional but recommended. Vapid credentials for push notifications
- VAPID_PUBLIC_KEY: same as above
- VAPID_PRIVATE_KEY: same as above
- RESEND: optional, for sending emails
- PORT: optional, port for the nodejs backend, defaults to 2000. Generally speaking, you don’t need to modify this at all.
- SECRET: a long randomized string used for hashing passwords and sessions. Just enter a random string.
- ADMIN_EMAIL: optional, sets the email sender. If you have set RESEND, set this to one of your verified domain’s emails.
- REMOVE_EVENTS_AT: optional, sets when a event is removed from the system. Defaults to one year.
- REMOVE_TEST_EVENTS_AT: optional, sets when a test event is removed from the system. Defaults to seven days.
- CORS: optional. If you’ve set APP_URL, you don’t need this. But if your frontend can’t connect to your backend, set this to ”*”
We have more documentation about env vars here.
Building the docker image manually
I don’t recommend this since building from the Docker image is simpler. But if you want to modify the codebase locally, this guide might be for you.
- Clone the github repo
cd
into the repo- Run
docker build -t operational .
- The run the docker operational container.