56 lines
1.6 KiB
Markdown
56 lines
1.6 KiB
Markdown
## Production Install (Ubuntu + systemd)
|
|
|
|
This file covers production installation only. For all other docs, see README.md.
|
|
|
|
### Prerequisites
|
|
- Ubuntu server with sudo/root access
|
|
- Docker and Docker Compose plugin already installed
|
|
|
|
### Configure environment
|
|
1. Copy example env and set required values:
|
|
- `cp .env.example .env`
|
|
- Edit `.env` and set at least: `GOOGLE_API_KEY`
|
|
|
|
### Install
|
|
1. Copy or clone the repo onto the server
|
|
2. Run the installer:
|
|
- `sudo ./install.sh`
|
|
|
|
What the installer does:
|
|
- Syncs the repo to `/opt/ploughshares`
|
|
- Ensures `/opt/ploughshares/.env` exists
|
|
- Installs and enables:
|
|
- `ploughshares-compose.service`
|
|
- `ploughshares-daily-restart.timer` (03:15 daily)
|
|
- Starts the stack
|
|
|
|
### Change daily restart time
|
|
```bash
|
|
sudo systemctl edit ploughshares-daily-restart.timer
|
|
# In [Timer] set: OnCalendar=*-*-* HH:MM:SS
|
|
sudo systemctl daemon-reload
|
|
sudo systemctl restart ploughshares-daily-restart.timer
|
|
```
|
|
|
|
### Manage
|
|
- Status:
|
|
- `systemctl status ploughshares-compose.service`
|
|
- `systemctl status ploughshares-daily-restart.timer`
|
|
- Start/Stop/Restart:
|
|
- `sudo systemctl start|stop|restart ploughshares-compose.service`
|
|
- Logs:
|
|
- Daily restart: `/var/log/ploughshares-restart.log`
|
|
|
|
### Uninstall
|
|
```bash
|
|
sudo systemctl disable --now ploughshares-daily-restart.timer
|
|
sudo systemctl disable --now ploughshares-compose.service
|
|
sudo rm -f /etc/systemd/system/ploughshares-daily-restart.timer
|
|
sudo rm -f /etc/systemd/system/ploughshares-daily-restart.service
|
|
sudo rm -f /etc/systemd/system/ploughshares-compose.service
|
|
sudo systemctl daemon-reload
|
|
sudo rm -rf /opt/ploughshares
|
|
```
|
|
|
|
|