Skip to content

Commit 3ae53f7

Browse files
one off jobs for rails db migrations
1 parent 4666260 commit 3ae53f7

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

samples/rails/compose.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,21 @@ services:
2525
retries: 5
2626
depends_on:
2727
- db
28+
- migrate
29+
migrate:
30+
restart: "no"
31+
build:
32+
context: ./app
33+
dockerfile: Dockerfile
34+
env_file:
35+
- .env
36+
environment:
37+
POSTGRES_PASSWORD:
38+
command: ["bin/rails", "db:prepare"]
39+
depends_on:
40+
db:
41+
condition: service_healthy
42+
2843
db:
2944
restart: unless-stopped
3045
image: postgres:16

0 commit comments

Comments
 (0)