Skip to content

Commit ab54533

Browse files
rnwstrsa33
authored andcommitted
Set WorkingDirectory in systemd unit and cd in scripts
1 parent 739957b commit ab54533

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

content/tutorials/websites/deploy-a-web-app.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ The scripts provided here are just examples and won't necessarily be perfect for
258258
#!/bin/bash -e
259259
260260
. ~/myapp/venv/bin/activate
261-
export PYTHONPATH='/home/crsid/myapp'
261+
cd ~/myapp
262262
exec gunicorn -w 2 -b unix:/home/crsid/myapp/web.sock \
263263
--log-file - main:app
264264
```
@@ -357,6 +357,7 @@ crashes. We highly recommend using `systemd` to supervise your app.
357357
WantedBy=default.target
358358
359359
[Service]
360+
WorkingDirectory=/home/{CRSid}/myapp
360361
ExecStart=/home/{CRSid}/myapp/run.sh
361362
Restart=always
362363
```

0 commit comments

Comments
 (0)