File: //lib/systemd/system/bigagi.service
[Unit]
Description=BigAGI v2 Service
After=network.target
[Service]
Type=simple
User=bigagiuser
Group=bigagiuser
# Ensure the environment variables are set (if necessary)
Environment=POSTGRES_PRISMA_URL=postgresql://pamide_bagi:ehitht7KVQ57yuhEie@localhost/pamide_bigagi?pgbouncer=true&connect_timeout=15
Environment=POSTGRES_URL_NON_POOLING=postgresql://pamide_bagi:ehitht7KVQ57yuhEie@localhost/pamide_bigagi
Environment=OPENAI_API_KEY=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
Environment=OPENAI_API_ORG_ID=org-bsPq67rwBcKJBl9pY2Jap6kC
Environment=OLLAMA_API_HOST=http://plano.panomity.com:11434
Environment=ELEVENLABS_API_KEY=b5fe91032ddc51a45aeb80b01bd83261
Environment=ELEVENLABS_VOICE_ID=s6JEnktI5mBonzQYOyGS
Environment=GOOGLE_CLOUD_API_KEY=AIzaSyAVEFy31Gi4v5Ry9rUj4-kQmHabaweFCu8
Environment=GOOGLE_CSE_ID=850431a30d7d84783
WorkingDirectory=/opt/bigagi2/big-AGI
ExecStart=npx next start --port 3834
# ExecStart=/usr/bin/docker compose up
ExecStop=/usr/bin/docker compose down
Restart=on-failure
# Use the private /tmp and /var/tmp, which is a new namespace of /tmp and /var/tmp for the process
PrivateTmp=true
# The number of seconds to wait for the service to start before systemd gives up
TimeoutStartSec=30
# The number of seconds to wait for the service to stop before systemd gives up
TimeoutStopSec=30
[Install]
WantedBy=multi-user.target