Skip to content

Commit 672029a

Browse files
authored
clearing up some installation instructions (#164)
* clearing up some installation instructions
1 parent 266d18e commit 672029a

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ manage virtual environments. These docs assume `venv`.
4343
- Unix, Windows, and MacOS [installation and use guide for venv](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/).
4444
- Your operating system might have some prerequisites here. On ubuntu, you may need:
4545
```sh
46-
sudo apt-install python3-pip python3.12-venv
46+
sudo apt install python3-pip python3.12-venv
4747
```
4848
1. Set up the virtual environment and run it. Run these commands in the
4949
directory where you've cloned the repository. (Adapt as needed for your shell
@@ -79,8 +79,6 @@ When you're done with the virtual environment, you can type `deactivate` to leav
7979
python -m build && \
8080
pip install dist/*.whl
8181
```
82-
-NOTE: In the current development stage of the project, we may exhibit code changes without change of the version number. In case you update your local code, this build process has to be repeated, but with the last command modified to ```pip install dist/*.whl --force-reinstall```
83-
- In the file ```soundcork/gunicorn_conf.py```, replace the binding address 127.0.0.1 by the IP address of your server
8482
- If using systemd, make a copy of `soundcork.service.example`, named `soundcork.service`
8583
- modify the placeholder strings appropriately
8684
- then mv to systemd and enable.
@@ -90,6 +88,14 @@ When you're done with the virtual environment, you can type `deactivate` to leav
9088
sudo systemctl enable soundcork && \
9189
sudo systemctl start soundcork
9290
```
91+
- To update the server, rebuild the project and restart. NOTE: In the current development stage of the project, we code changes may happen without a change of the version number. In these cases, or if you update your local code yourself, this build process has to be repeated, but with the last command modified to ```pip install dist/*.whl --force-reinstall```:
92+
```
93+
git pull
94+
pip install build && \
95+
python -m build && \
96+
pip install dist/*.whl --force-reinstall
97+
sudo systemctl restart soundcork
98+
```
9399

94100
You can verify the server by checking the `/docs` endpoint at your URL.
95101

soundcork.service.example

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,20 @@ After=network.target
77

88
[Service]
99

10-
User=YOUR_USER_NAME_HERE
10+
PIDFile=/run/soundcork.pid
1111

12-
Group=YOUR_GROUP_NAME_HERE
12+
# user soundcork should run as
13+
User=${USER}
1314

14-
WorkingDirectory=YOUR_DIRECTORY_NAME_HERE
15+
# ${INSTALL_DIR} should be the root of your git checkout, so the resulting
16+
# WorkingDirectory will probably be something like .../soundcork/soundcork
17+
WorkingDirectory=${INSTALL_DIR}/soundcork
1518

16-
ExecStart=YOUR_DIRECTORY_NAME_HERE/.venv/bin/gunicorn -c gunicorn_conf.py main:app
19+
# ditto on ${INSTALL_DIR}, though this time the resulting file should be
20+
# more like .../soundcork/.venv/bin/gunicorn
21+
# replace 0.0.0.0:8000 with 127.0.0.1:8000 if you are running behind
22+
# a webserver like nginx and don't want direct access from the outside
23+
ExecStart=${INSTALL_DIR}/.venv/bin/gunicorn -c gunicorn_conf.py -b 0.0.0.0:8000 main:app
1724

1825

1926
[Install]

0 commit comments

Comments
 (0)