Skip to content
Discussion options

You must be logged in to vote

In docker-compose.override.yml comment out the following lines

    command:
      - fastapi
      - run
      - --reload
      - "app/main.py"

and uncomment the line above

    # command: sleep infinity  # Infinite loop to keep container alive doing nothing

Then run docker compose watch and in new terminal, attach to the container with docker compose exec backend bash.
Now you can see something like

root@7f2607af31c3:/app#

You are inside the backend container and can run alembic commands

Docs: https://github.com/fastapi/full-stack-fastapi-template/blob/master/backend/README.md#docker-compose-override

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by YuriiMotov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
3 participants