Skip to content

Commit bde5c5c

Browse files
arealmaasoskogstad
andauthored
chore: add migration in docker compose (#626)
<!--- Provide a general summary of your changes in the Title above --> ## Description Ensures that migrations are run when running docker-compose <!--- Describe your changes in detail --> ## Related Issue(s) - #{issue number} ## Verification - [X] **Your** code builds clean without any errors or warnings - [X] Manual testing done (required) - [X] Relevant automated test added (if you find this hard, leave it and we'll help out) ## Documentation - [X] Documentation is updated (either in `docs`-directory, Altinnpedia or a separate linked PR in [altinn-studio-docs.](https://github.com/Altinn/altinn-studio-docs), if applicable) --------- Co-authored-by: Ole Jørgen Skogstad <skogstad@softis.net>
1 parent 2f86d7e commit bde5c5c

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

docker-compose-no-webapi.yml

+18-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,18 @@ services:
1616
interval: 2s
1717
timeout: 20s
1818
retries: 5
19-
19+
20+
dialogporten-migrations:
21+
build:
22+
context: .
23+
dockerfile: src/Digdir.Domain.Dialogporten.Infrastructure/MigrationBundle.dockerfile
24+
environment:
25+
- Infrastructure__DialogDbConnectionString=${DB_CONNECTION_STRING}
26+
depends_on:
27+
dialogporten-postgres:
28+
condition: service_healthy
29+
restart: "no"
30+
2031
dialogporten-redis:
2132
image: redis:6.0-alpine
2233
restart: always
@@ -36,10 +47,12 @@ services:
3647
depends_on:
3748
dialogporten-postgres:
3849
condition: service_healthy
50+
dialogporten-migrations:
51+
condition: service_completed_successfully
3952
environment:
4053
- Infrastructure:DialogDbConnectionString=${DB_CONNECTION_STRING}
4154
- ASPNETCORE_ENVIRONMENT=Development
42-
55+
4356
dialogporten-cdc:
4457
build:
4558
context: .
@@ -48,6 +61,9 @@ services:
4861
depends_on:
4962
dialogporten-postgres:
5063
condition: service_healthy
64+
dialogporten-migrations:
65+
condition: service_completed_successfully
66+
5167
environment:
5268
- ASPNETCORE_ENVIRONMENT=Development
5369
- Infrastructure:DialogDbConnectionString=${DB_CONNECTION_STRING}

docker-compose.yml

+4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ services:
1111
depends_on:
1212
- dialogporten-webapi
1313
restart: always
14+
1415
dialogporten-webapi:
1516
scale: 2
1617
build:
@@ -22,6 +23,8 @@ services:
2223
condition: service_healthy
2324
dialogporten-redis:
2425
condition: service_healthy
26+
dialogporten-migrations:
27+
condition: service_completed_successfully
2528
environment:
2629
- Infrastructure:Redis:ConnectionString=dialogporten-redis:6379
2730
- Infrastructure:DialogDbConnectionString=${DB_CONNECTION_STRING}
@@ -32,3 +35,4 @@ services:
3235
- ASPNETCORE_ENVIRONMENT=Development
3336
volumes:
3437
- ./.aspnet/https:/https
38+

0 commit comments

Comments
 (0)