File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -51,7 +51,8 @@ Feel free to build on this foundation for richer APIs or interfaces.
5151The ` deploy/deploy.sh ` script provisions the application on a Linux host using ` systemd ` . It:
5252
5353- Syncs the repository into ` /opt/nasa-sky-app/app ` (configurable with ` APP_ROOT ` ).
54- - Creates a virtual environment and installs dependencies.
54+ - Ensures ` /opt/nasa-sky-app ` exists with the proper ownership, then syncs code and creates a
55+ virtual environment for dependencies.
5556- Generates a ` systemd ` unit that runs Uvicorn on port ` 80 ` by default.
5657- Enables and restarts the service.
5758
Original file line number Diff line number Diff line change @@ -56,7 +56,12 @@ if ! command -v "${PYTHON_BIN}" >/dev/null 2>&1; then
5656 exit 1
5757fi
5858
59- mkdir -p " ${APP_DIR} "
59+ if [ ! -d " ${APP_ROOT} " ]; then
60+ ${SUDO_BIN} mkdir -p " ${APP_ROOT} "
61+ fi
62+ ${SUDO_BIN} mkdir -p " ${APP_DIR} " " ${VENV_DIR} "
63+ ${SUDO_BIN} chown -R " ${SERVICE_USER} :${SERVICE_GROUP} " " ${APP_ROOT} "
64+
6065rsync -a --delete \
6166 --exclude " .git" \
6267 --exclude " .venv" \
You can’t perform that action at this time.
0 commit comments