Skip to content

Commit

Permalink
Add example systemd files for running constellate on VPS
Browse files Browse the repository at this point in the history
  • Loading branch information
mrchrisadams committed Aug 19, 2024
1 parent c38bdf0 commit c4cd511
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
7 changes: 3 additions & 4 deletions docs/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,20 @@ just tailwind-build

Next you'll need to serve the application behind an apache or nginx acting as a reverse proxy. Django's [own documentation is on deploying with WSGI/Gunicorn](https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/gunicorn/), is stellar.

See the sample `systemd.cl8.service.example` for an example of a systemd service file to run on a virtual private server.

### Serve the uploaded media files

In production, Constellate assumes that uploaded media is stored on an object store like an AWS S3 bucket or similar.
In production, Constellate assumes that uploaded media is stored on an object store like an AWS S3 bucket or similar.

If you are storing the files on a local file system, and storing files on the same server as the running application running comment out the entire `STORAGES` stanza of `production.py`, to use the local filesystem.

For more, see [django's own extensive documentation on deployment](https://docs.djangoproject.com/en/3.0/howto/deployment/).




```
```
16 changes: 16 additions & 0 deletions docs/systemd.cl8.service.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[Unit]
Description=Gunicorn instance for serving constellate in production
After=network.target

[Service]

User=ubuntu
Group=www-data
WorkingDirectory=/path/to/constellate
ExecStart=/path/to/constellate/run-gunicorn.sh

Restart=always
RuntimeMaxSec=86400

[Install]
WantedBy=default.target

0 comments on commit c4cd511

Please sign in to comment.