1.6 KiB
Installation
First, install Python in version ≥ 3.9
There are several ways to run Juggl api.
- Directly via virtual environment
- In an automatically managed docker container
- In a manually created docker container
Virtual Environment
Go to the backend directory.
$ cd backend
Create virtual environment:
$ python -m venv/ ./venv/
Activate virtual environment (Linux):
$ source venv/bin/activate
Activate virtual environment (Windows):
$ .venv\Scripts\activate
Run inside backend/
:
Note the
-m
here. This causes python to execute the program as a module, not as a script, which would result in broken imports.
$ python -m src.main
Docker
Install Docker and Docker-Compose.
Docker-compose
Automatically set up all dependencies, export ports and start container(s) with docker-compose.
Build composed container setup:
$ docker-compose build
Start and block terminal with output
$ docker-compose up
Start in background (as deamon)
$ docker-compose up -d
Stop all containers
$ docker-compose down
Manual container
Build and execute the docker container manually.
Build container
docker build -t juggl-api .
Start container
Execute the previously bild container.
Don't forget to export the port from the container to your host system with -p HOST_PORT:CONTAINER_PORT
.
docker run -p 8192:8192 juggl-api