Skip to content

Commit db63c9b

Browse files
authored
platform: linux/amd64
1 parent 4ea6433 commit db63c9b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

docker/docker-compose-for-django-development.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ services:
3131
POSTGRES_PASSWORD: postgres
3232
web:
3333
container_name: myapp
34+
platform: linux/amd64
3435
build:
3536
context: .
3637
dockerfile: Dockerfile.dev
@@ -46,6 +47,7 @@ services:
4647
- migrations
4748
- database
4849
migrations:
50+
platform: linux/amd64
4951
build:
5052
context: .
5153
dockerfile: Dockerfile.dev
@@ -63,6 +65,8 @@ The `web` container runs the Django development server, built using the custom `
6365

6466
The `migrations` container simply runs the apps migrations and then terminates - with `depends_on` used to ensure that migrations run after the hdatabase server starts and before the web server.
6567

68+
Both `web` and `migrations` include a `platform: linux/amd64` property - this ensures they will work on M1 Macs even if the Python dependencies are not yet easily compiled for that architecture, see [Running Docker on an M1 Mac](https://til.simonwillison.net/macos/running-docker-on-remote-m1).
69+
6670
The `container_name: myapp` field on the `web` container is a convenience which means you can later run commands like this:
6771

6872
docker exec -it myapp ./manage.py collectstatic

0 commit comments

Comments
 (0)