Skip to content

Commit

Permalink
Update docker-compose examples (#6566)
Browse files Browse the repository at this point in the history
* Change volume for strapi in SQLite for consistency

Changed volume bind mount from `./:/srv/app` to `./app:/srv/app` to match path used in PostgreSQL and MongoDB example

Signed-off-by: azrikahar <42867097+azrikahar@users.noreply.github.com>

* Remove "links" option for PostgreSQL & MongoDB

Signed-off-by: azrikahar <42867097+azrikahar@users.noreply.github.com>

* Add "depends_on" option for PostgreSQL & MongoDB

Signed-off-by: azrikahar <42867097+azrikahar@users.noreply.github.com>

* Changed volume for strapi in MongoDB example

Signed-off-by: azrikahar <42867097+azrikahar@users.noreply.github.com>

* Add database init name environment variables

Signed-off-by: azrikahar <42867097+azrikahar@users.noreply.github.com>

* Remove exposed ports for databases

Signed-off-by: azrikahar <42867097+azrikahar@users.noreply.github.com>

* Update docker.md

Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com>
  • Loading branch information
azrikahar and alexandrebodin committed Jul 29, 2020
1 parent cf278ae commit 56e4426
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions docs/v3.x/installation/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ services:
strapi:
image: strapi/strapi
volumes:
- ./:/srv/app
- ./app:/srv/app
ports:
- '1337:1337'
```
Expand All @@ -42,22 +42,21 @@ services:
DATABASE_PORT: 5432
DATABASE_USERNAME: strapi
DATABASE_PASSWORD: strapi
links:
- postgres:postgres
volumes:
- ./app:/srv/app
ports:
- '1337:1337'
depends_on:
- postgres

postgres:
image: postgres
environment:
POSTGRES_DB: strapi
POSTGRES_USER: strapi
POSTGRES_PASSWORD: strapi
volumes:
- ./data:/var/lib/postgresql/data
ports:
- '5432:5432'
```

:::
Expand All @@ -76,22 +75,21 @@ services:
DATABASE_PORT: 27017
DATABASE_USERNAME: strapi
DATABASE_PASSWORD: strapi
links:
- mongo:mongo
volumes:
- ./app:/srv/app
ports:
- '1337:1337'
depends_on:
- mongo

mongo:
image: mongo
environment:
MONGO_INITDB_DATABASE: strapi
MONGO_INITDB_ROOT_USERNAME: strapi
MONGO_INITDB_ROOT_PASSWORD: strapi
volumes:
- ./data/db:/data/db
ports:
- '27017:27017'
- ./data:/data/db
```

:::
Expand Down

0 comments on commit 56e4426

Please sign in to comment.