- A VPS running Ubuntu 22.04+
- Docker and Docker Compose installed
- A domain name pointing to your VPS IP address (e.g.,
oms.toko-optik.com)
Copy the .env.example in both backend and frontend to .env and fill them out. Note that docker-compose.yml injects the production variables automatically.
Run the following from the root directory:
docker-compose up -d --buildThis will start:
- PostgreSQL on port 5432
- Backend (Hono) on port 3000
- Frontend (Nginx/ReactRouter) on port 80
If you have a domain, secure it with HTTPS using Nginx and Certbot.
- Install Certbot:
sudo apt update
sudo apt install certbot python3-certbot-nginx- Run Certbot to automatically configure SSL for your domain:
sudo certbot --nginx -d oms.toko-optik.com- Ensure Nginx routes the frontend properly. The frontend Docker exposes port 80. You can set up a reverse proxy on the host machine's Nginx to point to the frontend Docker container.
Set up a daily cron job using the provided backup.sh script to dump the PostgreSQL database data safely.
crontab -e
# Add line:
0 2 * * * /root/optic-management-system/backup.sh