refactor(taskfiles): extract start logic out of taskfile
This commit is contained in:
parent
6b49313e3f
commit
0582f9877e
4 changed files with 22 additions and 7 deletions
|
@ -46,8 +46,10 @@ tasks:
|
|||
start:
|
||||
desc: "Starts the backend application."
|
||||
deps: [docker-build]
|
||||
cmd: docker run -d -p 8000:8000 --name {{ .APP_CONTAINER_NAME }} {{ .CLI_ARGS }} --add-host docker.host.internal:host-gateway --env-file ../../backend.env rotini:dev
|
||||
dir: backend/rotini
|
||||
env:
|
||||
APP_CONTAINER_NAME: "{{ .APP_CONTAINER_NAME }}"
|
||||
cmd: . script/start.sh
|
||||
dir: backend
|
||||
stop:
|
||||
desc: "Stops the backend application."
|
||||
cmd: docker rm -f {{ .APP_CONTAINER_NAME }}
|
||||
|
|
|
@ -1,2 +1,7 @@
|
|||
DJANGO_SECRET_KEY="notakey"
|
||||
JWT_SIGNING_SECRET="notasecret"
|
||||
DB_HOST="rotini_db"
|
||||
DB_USER="postgres"
|
||||
DB_PASSWORD="postgres"
|
||||
DB_PORT=5432
|
||||
DB_NAME="postgres"
|
||||
|
|
|
@ -64,11 +64,11 @@ WSGI_APPLICATION = "base.wsgi.application"
|
|||
DATABASES = {
|
||||
"default": {
|
||||
"ENGINE": "django.db.backends.postgresql_psycopg2",
|
||||
"NAME": "postgres",
|
||||
"USER": "postgres",
|
||||
"PASSWORD": "test",
|
||||
"HOST": "docker.host.internal",
|
||||
"PORT": "5432",
|
||||
"NAME": os.environ["DB_NAME"],
|
||||
"USER": os.environ["DB_USER"],
|
||||
"PASSWORD": os.environ["DB_PASSWORD"],
|
||||
"HOST": os.environ["DB_HOST"],
|
||||
"PORT": os.environ["DB_PORT"],
|
||||
}
|
||||
}
|
||||
|
||||
|
|
8
backend/script/start.sh
Normal file
8
backend/script/start.sh
Normal file
|
@ -0,0 +1,8 @@
|
|||
#!/bin/bash
|
||||
|
||||
docker run \
|
||||
--detach \
|
||||
--publish 8000:8000 \
|
||||
--name $APP_CONTAINER_NAME \
|
||||
--env-file ../backend.env \
|
||||
rotini:dev
|
Reference in a new issue