Skip to content

Commit

Permalink
Update Docker examples to use Compose v2 command (#51134)
Browse files Browse the repository at this point in the history
Compose v1 has reached EOL, and will no longer be included with Docker after June 2023: https://www.docker.com/blog/docker-desktop-4-19/
  • Loading branch information
maxproske committed Jun 14, 2023
1 parent 5e9b5e5 commit 28dca13
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion examples/with-docker-compose/.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# DO NOT ADD SECRETS TO THIS FILE. This is a good place for defaults.
# If you want to add secrets use `.env.production.local` instead, which is automatically detected by docker-compose.
# If you want to add secrets use `.env.production.local` instead, which is automatically detected by `docker compose`.

ENV_VARIABLE=production_server_only_variable
NEXT_PUBLIC_ENV_VARIABLE=production_public_variable
14 changes: 6 additions & 8 deletions examples/with-docker-compose/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,10 @@ First, run the development server:
docker network create my_network

# Build dev
# Note: Keep v1 command until "Use Docker Compose v2" is enabled by default for Docker Desktop for Linux
# Docker aliases `docker-compose` (v1 command) to `docker compose` (v2 command), but not the other way around
docker-compose -f docker-compose.dev.yml build
docker compose -f docker-compose.dev.yml build

# Up dev
docker-compose -f docker-compose.dev.yml up
docker compose -f docker-compose.dev.yml up
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
Expand All @@ -70,10 +68,10 @@ First, run the production server (Final image approximately 110 MB).
docker network create my_network

# Build prod
docker-compose -f docker-compose.prod.yml build
docker compose -f docker-compose.prod.yml build

# Up prod in detached mode
docker-compose -f docker-compose.prod.yml up -d
docker compose -f docker-compose.prod.yml up -d
```

Alternatively, run the production server without without multistage builds (Final image approximately 1 GB).
Expand All @@ -84,10 +82,10 @@ Alternatively, run the production server without without multistage builds (Fina
docker network create my_network

# Build prod without multistage
docker-compose -f docker-compose.prod-without-multistage.yml build
docker compose -f docker-compose.prod-without-multistage.yml build

# Up prod without multistage in detached mode
docker-compose -f docker-compose.prod-without-multistage.yml up -d
docker compose -f docker-compose.prod-without-multistage.yml up -d
```

Open [http://localhost:3000](http://localhost:3000).
Expand Down
2 changes: 1 addition & 1 deletion examples/with-temporal/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ The Temporal Node SDK requires [Node `>= 14`, `node-gyp`, and Temporal Server](h
In the Temporal Server docker directory:

```bash
docker-compose up
docker compose up
```

In the `next-temporal-app/` directory:
Expand Down

0 comments on commit 28dca13

Please sign in to comment.