Docker
-
DraftSmith can be installed and configured entirely through Docker, this will include the API, database and Web App:
Terminal window git clone https://github.com/RyanGreenup/draftsmith_rscd draftsmith_rs/containers/maindocker compose upThis will build a container with some dependencies and a clone of:
Directorydraftsmith_rs_py_client/
- …
Directorydraftsmith_flask/
- …
Directorydrafsmith_render/
- …
Directorydrafsmith_rs_api/
- …
- Compiled version of
- CLI for draftsmith_rs_api
- Virtual Environment for draftsmith_flask
The
docker-compose.ymlwill create 3 services:postgres- The database storing all the data
app- This is the REST API that communicates with the database
scripts/entrypoint.shwill check for a marker file and if it’s not found:- Create a database
- Initialize that database with tables etc. (using Diesel migrations)
web-app- The web application communicating with the REST API
scripts/web_entrypoint.shwill source the virtual environment (created in the image) and run the web app
- The web application communicating with the REST API
-
Users can jump inside the container to interact directly with the REST API or database if they wish:
Terminal window docker compose exec -it app /bin/sh# Ordocker compose exec -it app /bin/fishdocker compose exec -it app /usr/sbin/nuOr call the client without forwarding the REST API to the system:
Terminal window # change this according to the docker-composeAPI_PORT=37242docker compose exec -it app draftsmith client --url 'http://localhost:'$API_PORT notes tree | jq