This repository has been archived by the owner on May 3, 2024. It is now read-only.
forked from EGCETSII/decide
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
feat(devcontainer): create devcontainer definition
This sets up a complete development environment for Decide, which can be used locally with Docker or in the cloud with GitHub Codespaces Signed-off-by: GitHub <noreply@github.com>
Showing
4 changed files
with
50 additions
and
2 deletions.
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,29 @@ | ||
{ | ||
"name": "Decide Codespace", | ||
"image": "python:latest", | ||
"features": { | ||
"ghcr.io/devcontainers/features/docker-in-docker:2": { | ||
"dockerDashComposeVersion": "v2" | ||
}, | ||
"ghcr.io/devcontainers/features/github-cli:1": {}, | ||
"ghcr.io/eitsupi/devcontainer-features/jq-likes:2": {}, | ||
"ghcr.io/devcontainers/features/node:1": {}, | ||
"ghcr.io/devcontainers-contrib/features/apt-packages:1": { | ||
"preserve_apt_list": false, | ||
"packages": ["postgresql", "libpq-dev", "htop"] | ||
} | ||
}, | ||
"postCreateCommand": { | ||
"npm": "npm ci --workspaces", | ||
"pip": "pip install -r requirements.txt", | ||
"use-bash": "rm -rf /bin/sh && ln -s /bin/bash /bin/sh", | ||
"git-editor": "git config --global core.editor 'code --wait'", | ||
"git-template": "git config commit.template .gitmessage.txt", | ||
"postunpack": "service postgresql start && .devcontainer/postunpack.sh" | ||
}, | ||
"postAttachCommand": { | ||
"extensions": "cat .vscode/extensions.json | jq -r .recommendations[] | xargs -n 1 code --install-extension", | ||
"postgres": "service postgresql start" | ||
}, | ||
"hostRequirements": { "cpus": 4, "memory": "8gb" } | ||
} |
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,14 @@ | ||
#!/bin/bash | ||
|
||
## This script finishes the installation of the devcontainer | ||
## | ||
## Currently it just sets up the database user using decide's local_settings.py default values | ||
## If you want to modify those credentials, | ||
## you can alter them at any time manually: https://stackoverflow.com/questions/12720967/how-can-i-change-a-postgresql-user-password | ||
|
||
su - postgres <<EOSQL | ||
psql -c "create user decide with password 'decide'" | ||
psql -c "create database decide owner decide" | ||
EOSQL | ||
|
||
echo "127.0.0.1 db" >> /etc/hosts |
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,5 @@ | ||
{ | ||
"recommendations": [ | ||
"ms-python.python" | ||
] | ||
} |
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