Skip to content

Commit

Permalink
Merge pull request #177 from NikitaZotov/fix/venv_docs
Browse files Browse the repository at this point in the history
Fix docker and mention venv in docs
  • Loading branch information
NikitaZotov authored Jan 13, 2025
2 parents 4f0342e + 3bca8f0 commit e4197a7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#nodejs stage to build frontent
# nodejs stage to build frontend
FROM node:16-alpine AS web-buildenv

WORKDIR /sc-web
#Install sc-web build-time dependencies
# Install sc-web build-time dependencies
COPY package.json package-lock.json ./
RUN npm install
#Build sc-web
# Build sc-web
COPY . .
RUN npm run build

FROM ubuntu:focal as runtime
FROM ubuntu:focal AS runtime
USER root

WORKDIR /sc-web
Expand All @@ -35,4 +35,4 @@ COPY --from=web-buildenv /sc-web/sc-web.ini /sc-web/sc-web.ini
WORKDIR /sc-web/server

EXPOSE 8000
ENTRYPOINT ["/usr/bin/tini", "--", "/sc-web/scripts/run_sc_web.sh" ]
ENTRYPOINT ["/usr/bin/tini", "--", "/sc-web/scripts/docker_entrypoint.sh"]
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ Otherwise, the following dependencies should be installed:
Node.js and Python libraries can be installed using the respective package managers

```sh
python3 -m venv .venv
source .venv/bin/activate
pip3 install -r requirements.txt
npm install
```
Expand All @@ -66,11 +68,12 @@ npm run build

### Run the server

Note: sc-web backend requires `sc-machine` to be up and running, check `python3 server/app.py --help` for network configuration options.
Note: sc-web backend requires `sc-machine` to be up and running, check `source .venv/bin/activate && python3 server/app.py --help` for network configuration options.

To launch the backend server, run:

```sh
source .venv/bin/activate
python3 server/app.py
```

Expand Down
7 changes: 7 additions & 0 deletions scripts/docker_entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
set -eo pipefail

SC_WEB_PATH=$(cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && cd .. && pwd)

source "${SC_WEB_PATH}/.venv/bin/activate"
python3 "${SC_WEB_PATH}/server/app.py" "$@"

0 comments on commit e4197a7

Please sign in to comment.