From ba3af43820ac3a2e78639df9b999a853ad884a31 Mon Sep 17 00:00:00 2001 From: Joseph Freeston Date: Thu, 12 Sep 2024 00:24:21 +0000 Subject: [PATCH 1/2] Add app-server, api-server to devcontainer PATH --- .devcontainer/api-server | 3 ++- .devcontainer/app-server | 3 ++- .devcontainer/devcontainer.json | 3 +++ .devcontainer/docker-compose.yml | 4 ++-- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.devcontainer/api-server b/.devcontainer/api-server index 284f930..e50c9bd 100755 --- a/.devcontainer/api-server +++ b/.devcontainer/api-server @@ -1,3 +1,4 @@ #!/bin/bash -.venv-api/bin/flask --app cubeserver_api run --port 8081 "$@" \ No newline at end of file +cd /code/ +.venv-api/bin/flask --app cubeserver_api run --port 8081 "$@" diff --git a/.devcontainer/app-server b/.devcontainer/app-server index dad4ff0..51b806e 100755 --- a/.devcontainer/app-server +++ b/.devcontainer/app-server @@ -1,3 +1,4 @@ #!/bin/bash -.venv-app/bin/flask --app cubeserver_app.main run --port 8080 "$@" \ No newline at end of file +cd /code/ +.venv-app/bin/flask --app cubeserver_app.main run --port 8080 "$@" diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index f86ff47..00e3630 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -7,6 +7,9 @@ 8080, 8081 ], + "remoteEnv": { + "PATH": "${containerEnv:PATH}:/code/bin/" + }, "customizations": { "vscode": { "extensions": [ diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index 31247c0..649279c 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -14,8 +14,8 @@ services: - ../src/CubeServer-api/requirements.txt:/code/requirements-api.txt:cached - ../src/CubeServer-app/cubeserver_app:/code/cubeserver_app:cached - ../src/CubeServer-app/requirements.txt:/code/requirements-app.txt:cached - - ./api-server:/code/api-server:cached - - ./app-server:/code/app-server:cached + - ./api-server:/code/bin/api-server:cached + - ./app-server:/code/bin/app-server:cached - ../Docker/CubeServer/CubeServer-app/package_internal.sh:/code/package_internal.sh:cached - ../Docker/CubeServer/CubeServer-app/package_lib.sh:/code/package_lib.sh:cached build: From 8b780fa12945b9231f2159f9d1372b403250a662 Mon Sep 17 00:00:00 2001 From: Joseph Freeston Date: Thu, 12 Sep 2024 00:24:32 +0000 Subject: [PATCH 2/2] Add basic devcontainer docs --- README-DEV.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 README-DEV.md diff --git a/README-DEV.md b/README-DEV.md new file mode 100644 index 0000000..451f5de --- /dev/null +++ b/README-DEV.md @@ -0,0 +1,16 @@ +# DevContainer Setup + +Either use the devcontainer locally or in GitHub Codespaces. +Once the container is built, the ports will automatically be forwarded. + +To run the development webapp server, simply open a terminal in the devcontainer and run: + +``` bash +app-server +``` + +To run the development api server, simply open a terminal in the devcontainer and run: + +``` bash +api-server +```