-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
To support this the `flask` wrapper will detech whether `SETTINGS_FILE` is set, and if so assume we're already running within a container.
- Loading branch information
Showing
3 changed files
with
68 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
{ | ||
"name": "EMF Web", | ||
// Compose config | ||
"dockerComposeFile": "../docker-compose.yml", | ||
"service": "app", | ||
"workspaceFolder": "/app", | ||
"containerEnv": { | ||
"EDITOR": "code -w" | ||
}, | ||
// Replace the standard command with a noop to allow exec-ing | ||
"overrideCommand": true, | ||
// Git complains if user IDs don't match, which they will with a mounted directory | ||
"onCreateCommand": "git config --global --add safe.directory /app", | ||
// Port forwarding | ||
"forwardPorts": [ | ||
2342, | ||
"db:5432" | ||
], | ||
"portsAttributes": { | ||
"2342": { | ||
"label": "Web", | ||
"onAutoForward": "silent", | ||
"requireLocalPort": false | ||
}, | ||
"db:5432": { | ||
"label": "Postgres", | ||
"onAutoForward": "silent", | ||
"requireLocalPort": false | ||
} | ||
}, | ||
// VSCode additions | ||
"features": {}, | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"dbaeumer.vscode-eslint", | ||
"EditorConfig.EditorConfig", | ||
"github.vscode-github-actions", | ||
"ms-python.python", | ||
"ms-python.black-formatter", | ||
"ms-python.flake8", | ||
"ms-python.mypy-type-checker" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
#!/usr/bin/env bash | ||
# Shim to run the Flask admin command within docker | ||
docker compose exec -e SETTINGS_FILE=./config/development.cfg app poetry run flask "$@" | ||
if [ -z "${SETTINGS_FILE}" ]; then | ||
docker compose exec -e SETTINGS_FILE=./config/development.cfg app poetry run flask "$@" | ||
else | ||
exec poetry run flask "$@" | ||
fi |