Skip to content
Snippets Groups Projects
Commit a5adbd13 authored by Nico Vermaas's avatar Nico Vermaas
Browse files

Merge branch 'hookup-to-django' into 'main'

Hookup to django

See merge request !6
parents 7910df3d 93f74f58
No related branches found
No related tags found
1 merge request!6Hookup to django
Pipeline #40644 passed with warnings
......@@ -30,7 +30,7 @@ docker-test-build:
- docker push $CI_REGISTRY_IMAGE$DOCKER_IMAGE_TAG
docker-build-master:
docker-build-main:
# Official docker image.
image: docker$DOCKER_BUILD_IMAGE_TAG
stage: build
......@@ -82,8 +82,7 @@ docker-deploy-main-test:
- ssh -o StrictHostKeyChecking=no sdc@dop814.astron.nl "docker-compose -p adex-backend -f /docker_compose/adex-backend-fastapi/docker-compose-dev-cd.yml up -d"
- echo "Application deployed"
when: manual
only:
- main
docker-deploy-main-production:
# image: docker:latest
......@@ -122,6 +121,5 @@ docker-deploy-main-production:
- ssh -o StrictHostKeyChecking=no sdco@dop821.astron.nl "docker-compose -p adex-backend -f /opt/dockercompose/adex-backend-fastapi/docker-compose-production-cd.yml up -d"
- echo "Application deployed"
when: manual
only:
- main
......@@ -8,7 +8,7 @@ from sqlalchemy.orm import sessionmaker
# DATABASE_URL = "postgresql://postgres:secret@145.38.187.31/adex_cache"
# read from environment
DATABASE_URL = os.environ.get('DATABASE_URL', 'postgresql://postgres:postgres@localhost/adex_cache')
DATABASE_URL = os.environ.get('DATABASE_URL', 'postgresql://postgres:postgres@localhost/adex_cache_fastapi')
print('DATABASE_URL = '+DATABASE_URL)
engine = create_engine(
......
......@@ -4,7 +4,8 @@ from .database import Base
# sql alchemy model
class SkyView(Base):
__tablename__ = "skyviews"
#__tablename__ = "skyviews" # using the adex_cache_fastapi.skyviews table
__tablename__ = "adex_cache_skyview" # using the adex_cache_django.adex_cache_skyview table
id = Column(Integer, primary_key=True, index=True)
pid = Column(String)
name = Column(String)
......
......@@ -20,7 +20,7 @@ services:
- traefik_proxy
- adex_network
env_file:
- $HOME/shared/adex_backend.env
- $HOME/shared/adex_backend_fastapi.env
volumes:
- $HOME/shared:/shared
- adex-cache-db:/var/lib/postgresql/data
......@@ -47,7 +47,7 @@ services:
depends_on:
- adex-cache-db
env_file:
- $HOME/shared/adex_backend.env
- $HOME/shared/adex_backend_fastapi.env
restart: always
volumes:
......
......@@ -9,7 +9,7 @@ from routers import skyviews
app = FastAPI(
title="ADEX backend",
description="ADEX backend FastAPI",
version="0.0.1",
version="1.0.0",
docs_url='/adex-fastapi/docs',
redoc_url='/adex-fastapi/redoc',
openapi_url='/adex-fastapi/openapi.json',
......
SET DATABASE_URL=postgresql://postgres:postgres@localhost/adex_cache_django
uvicorn main:app --reload
\ 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