Skip to content
Snippets Groups Projects
Commit 97938437 authored by Fanna Lautenbach's avatar Fanna Lautenbach
Browse files

Merge branch 'hotfix/celery-dataproducts' into 'main'

Correct local development enviroment

See merge request !49
parents aa6aec58 e72f2e7a
Branches
No related tags found
1 merge request!49Correct local development enviroment
Pipeline #41500 passed
......@@ -38,6 +38,10 @@ docker exec -ti ldv-specification python manage.py migrate --settings ldvspec.se
### Start developing
- Copy the `ldvspec.example.env`, rename it to `ldvspec.env` and fill in the variables. The variables should match the `local.py` settings which are coherent with the `docker-compose-local.yml` setup.
- Run the docker build for the base image of the Dockerfile
> docker build -f Dockerfile.base -t git.astron.nl:5000/astron-sdc/ldv-specification/base:latest .
- Run the docker-compose build for the local environment from folder `lvdspec` (_Note_: the path from which you build the docker-compose matters here!)
> docker-compose -f ./docker/docker-compose-local.yml build
- Run `docker-compose -f docker-compose-local.yml up -d` with the following compose file to spin up a new Postgres container, celery worker and rabbitMQ.
- Run the following python commands to start developing
- migrate
......
version: '3.4'
networks:
ldv_network:
traefik_proxy:
external:
name: traefik_proxy
default:
driver: bridge
......@@ -12,14 +9,15 @@ services:
image: postgres:14
container_name: ldv-spec-postgres
ports:
- "5433:5432"
- "5433:5433"
networks:
- traefik_proxy
- ldv_network
env_file:
- ../ldvspec.env
volumes:
- ldv-spec-db:/var/lib/postgresql/data
command:
- -p 5433
restart: always
rabbitmq:
......@@ -33,6 +31,9 @@ services:
ldv-specification-background:
container_name: ldv-specification-background
image: git.astron.nl:5000/astron-sdc/ldv-specification:${LDVSPEC_VERSION:-latest}
build:
context: ..
dockerfile: ./Dockerfile
networks:
- ldv_network
depends_on:
......@@ -40,8 +41,11 @@ services:
environment:
CELERY_BROKER_URL: amqp://guest@rabbitmq:5672
DJANGO_SETTINGS_MODULE: 'ldvspec.settings.local'
DATABASE_HOST_SERVER: ldv-spec-db
env_file:
- ../ldvspec.env
volumes:
- ../:/src/
command: celery -A ldvspec worker -l INFO
restart: always
......
DEBUG=True
POSTGRES_PASSWORD=secret
POSTGRES_USER=postgres
POSTGRES_DB=ldv-spec-db
DATABASE_HOST=ldv-spec-db
DATABASE_PORT=5433
DATABASE_NAME=ldv-spec-db
DATABASE_USER=postgres
DATABASE_PASSWORD=secret
ATDB_HOST=https://sdc-dev.astron.nl:5554/atdb/
CELERY_BROKER_URL=amqp://guest@localhost:5672
import os
from ldvspec.settings.base import *
DEV = True
......@@ -8,11 +10,11 @@ CORS_ORIGIN_ALLOW_ALL = True
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'USER': 'postgres',
'PASSWORD': 'secret',
'NAME': 'ldv-spec-db',
'HOST': 'localhost',
'PORT': '5433',
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'USER': os.getenv("POSTGRES_USER", "postgres"),
'PASSWORD': os.getenv("POSTGRES_PASSWORD", "secret"),
'NAME': os.getenv("DATABASE_NAME", "ldv-spec-db"),
'HOST': os.getenv("DATABASE_HOST_SERVER", "localhost"),
'PORT': os.getenv("DATABASE_PORT", "5433")
},
}
\ No newline at end of file
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment