Skip to content

Commit

Permalink
Use explicit relative path for migrations folder in docker-compose (#…
Browse files Browse the repository at this point in the history
…1934)

# Description

If I run `docker-compose up` in my system, I get an error:

<details><summary>Cannot create container for service migrations:
invalid mount config for type "bind": invalid mount path: 'database/sql'
mount path must be absolute</summary>

```
$ docker-compose up
Creating network "services_default" with the default driver
Creating services_chain_1 ... 
Creating services_adminer_1 ... 
Creating services_chain_1      ... done
Creating services_adminer_1    ... done

Creating services_db_1         ... done

ERROR: for migrations  Cannot create container for service migrations: invalid mount config for type "bind": invalid mount path: 'database/sql' mount path must be absolute
ERROR: Encountered errors while bringing up the project.
```
</details>

# Changes

The path is now explicitly relative. This makes `docker-compose` work on
my system and according to my understanding of [these
docs](https://github.com/compose-spec/compose-spec/blob/38143970dd693f321e9af012894a7da4e4244292/spec.md#short-syntax-5)
it's recommended way to write down relative paths.

## How to test

Please run `docker-compose` up in your system to make sure this PR isn't
breaking any local setup.
CI.
  • Loading branch information
fedgiac authored Oct 10, 2023
1 parent aa0daa9 commit e7c6207
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ services:
FLYWAY_URL: jdbc:postgresql://db/?user=$USER&password=
volumes:
- type: bind
source: database/sql/
source: ./database/sql/
target: /flyway/sql

chain:
Expand Down

0 comments on commit e7c6207

Please sign in to comment.