-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add tests for secrets helper (#40)
feat: remove default env on deletion feat: add local dev setup Makefile
- Loading branch information
1 parent
8d933a4
commit ee74705
Showing
10 changed files
with
270 additions
and
14 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
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,25 @@ | ||
|
||
.PHONY: local-dev | ||
local-dev: | ||
cp .env.sample .env | ||
echo "\nDEPLOYMENTS_MOUNT_DIR='$(PWD)/deployments' # DO NOT EDIT THIS - FIX FOR RESOURCE SHARING BUG" >> .env | ||
echo "\nNGINX_PROXY_CONF_LOCATION='$(PWD)/nginx-confs' # DO NOT EDIT THIS - FIX FOR RESOURCE SHARING BUG" >> .env | ||
echo "\nDEPLOYMENT_HOST='localhost' # DO NOT EDIT THIS" >> .env | ||
bash setup-vault.sh docker-compose-local.yml | ||
echo "\nVAULT_BASE_URL='http://localhost:8200'" >> .env | ||
mkdir deployments nginx-confs | ||
docker-compose -f docker-compose-local.yml up -d nginx | ||
|
||
.PHONY: sarthi | ||
sarthi: | ||
python app.py | ||
|
||
.PHONY: test | ||
test: | ||
python -m pytest -vvv tests | ||
|
||
.PHONY: reset | ||
reset: | ||
rm -f .env keys.txt parsed-key.txt ansi-keys.txt | ||
docker compose -f docker-compose-local.yml down -v | ||
rm -rf deployments nginx-confs |
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 |
---|---|---|
@@ -0,0 +1,63 @@ | ||
version: "3" | ||
|
||
services: | ||
nginx: | ||
image: nginx:latest | ||
restart: always | ||
container_name: sarthi_nginx | ||
ports: | ||
- "80:80" | ||
extra_hosts: | ||
- "host.docker.internal:host-gateway" | ||
volumes: | ||
- ./nginx-confs:/etc/nginx/conf.d | ||
|
||
sarthi: | ||
build: . | ||
restart: always | ||
volumes: | ||
# hack to bypass file resource sharing error | ||
# not tested and no support for windows server 💩 | ||
- ./deployments:${DEPLOYMENTS_MOUNT_DIR:-/deployments} | ||
- ./nginx-confs:${NGINX_PROXY_CONF_LOCATION:-/nginx-confs} | ||
- /var/run/docker.sock:/var/run/docker.sock | ||
extra_hosts: | ||
- "host.docker.internal:host-gateway" | ||
environment: | ||
DEPLOYMENTS_MOUNT_DIR: ${DEPLOYMENTS_MOUNT_DIR} | ||
NGINX_PROXY_CONF_LOCATION: ${NGINX_PROXY_CONF_LOCATION} | ||
ENV: ${ENV:-local} | ||
DOMAIN_NAME: ${DOMAIN_NAME:-localhost} | ||
VAULT_TOKEN: ${VAULT_TOKEN} | ||
VAULT_BASE_URL: ${VAULT_BASE_URL:-http://vault:8200} | ||
SECRET_TEXT: ${SECRET_TEXT} | ||
depends_on: | ||
- vault | ||
|
||
vault: | ||
image: vault:1.12.3 | ||
restart: always | ||
ports: | ||
- "8200:8200" | ||
volumes: | ||
- ./vault/vault.json:/vault/config/vault.json | ||
- vault-secrets-dev:/vault/file | ||
environment: | ||
VAULT_ADDR: http://0.0.0.0:8200 | ||
VAULT_API_ADDR: http://0.0.0.0:8200 | ||
VAULT_ADDRESS: http://0.0.0.0:8200 | ||
cap_add: | ||
- IPC_LOCK | ||
command: vault server -config=/vault/config/vault.json | ||
healthcheck: | ||
test: | ||
[ | ||
"CMD-SHELL", | ||
"wget --spider http://127.0.0.1:8200/v1/sys/health || exit 1", | ||
] | ||
interval: 10s | ||
timeout: 5s | ||
retries: 3 | ||
|
||
volumes: | ||
vault-secrets-dev: |
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
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
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