---
title: "Discussion on \"Run database migrations before your app starts in Docker Compose with service_completed_successfully\" | Hashnode"
description: "Discussion on \"Run database migrations before your app starts in Docker Compose with service_completed_successfully\". Your app expects its tables to exist by the time it takes its first request, so the migrations have to run first. In Docker Compose you can give that work its own short-lived service: it waits for the"
url: "https://hashnode.com/posts/run-database-migrations-before-your-app-starts-in-docker-compose-with-service-completed-successfully/6af489705ea01fe999646580"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Run database migrations before your app starts in Docker Compose with service\_completed\_successfully](https://shipkit.hashnode.dev/run-database-migrations-before-your-app-starts-in-docker-compose-with-service-completed-successfully?utm_source=hashnode&utm_medium=feed)

Your app expects its tables to exist by the time it takes its first request, so the migrations have to run first. In Docker Compose you can give that work its own short-lived service: it waits for the

5h ago · 7 min read · shipkit.hashnode.dev  
Read the article

-   [#docker](https://hashnode.com/tag/docker)
-   [#docker-compose](https://hashnode.com/tag/docker-compose)
-   [#devops](https://hashnode.com/tag/devops)
-   [#databases](https://hashnode.com/tag/databases)

## Written by

[ShipKit](https://hashnode.com/@shipkit)

@shipkit

  
[View profile](https://hashnode.com/@shipkit)

Teaching notes on GitHub Actions and Docker from ShipKit.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
