diff --git a/docker-compose.yml b/docker-compose.yml index 51ae787..6e3878b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -35,6 +35,8 @@ services: - POSTGRES_DB=microcentral ports: - "5432:5432" + volumes: + - postgres_data:/var/lib/postgresql/data backend: profiles: # will start only if `docker-compose --profile prod up` is used @@ -79,3 +81,5 @@ networks: backend: driver: bridge +volumes: + postgres_data: \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh index 0230204..b8c185f 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -14,7 +14,7 @@ fi # Run migrations to create tables #poetry run python app/manager.py init_db echo "Running migrations..." -poetry run alembic revision -m "Initial migration" +poetry run alembic revision --autogenerate -m "Initial migration" echo "Revision created" poetry run alembic upgrade head echo "Migrations complete"