Skip to content

Commit

Permalink
fix: Change docker-compose calls to docker compose (#613)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkleszcz authored Aug 14, 2024
1 parent 8725584 commit 26e3cf5
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 23 deletions.
4 changes: 2 additions & 2 deletions packages/backend/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"executor": "nx:run-commands",
"options": {
"color": true,
"commands": ["docker-compose build backend"],
"commands": ["docker compose build backend"],
"parallel": false
},
"dependsOn": ["setup", "build-email-renderer"]
Expand All @@ -38,7 +38,7 @@
"executor": "nx:run-commands",
"options": {
"color": true,
"command": "docker-compose run --rm -T backend ./scripts/runtime/run_tests.sh"
"command": "docker compose run --rm -T backend ./scripts/runtime/run_tests.sh"
},
"dependsOn": ["compose-build-image"]
},
Expand Down
11 changes: 6 additions & 5 deletions packages/backend/scripts/buildDocs.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ const { runCommand } = require('./lib/runCommand');

const GENERATED_BACKEND_DOCS_PATH = path.resolve(
__dirname,
'../docs/generated'
'../docs/generated',
);
const GENERATED_BACKEND_DOCS_INTERNAL_PATH = path.resolve(
__dirname,
'../../internal/docs/docs/api-reference/backend/generated'
'../../internal/docs/docs/api-reference/backend/generated',
);

(async () => {
Expand All @@ -18,8 +18,9 @@ const GENERATED_BACKEND_DOCS_INTERNAL_PATH = path.resolve(
await fs.remove(GENERATED_BACKEND_DOCS_PATH);

await runCommand(
'docker-compose',
'docker',
[
'compose',
'run',
'--rm',
'-T',
Expand All @@ -31,7 +32,7 @@ const GENERATED_BACKEND_DOCS_INTERNAL_PATH = path.resolve(
],
{
cwd: path.resolve(__dirname, '../../../'),
}
},
);

// Removing internal docs directory
Expand All @@ -40,7 +41,7 @@ const GENERATED_BACKEND_DOCS_INTERNAL_PATH = path.resolve(
// Copying docs
await fs.copy(
GENERATED_BACKEND_DOCS_PATH,
GENERATED_BACKEND_DOCS_INTERNAL_PATH
GENERATED_BACKEND_DOCS_INTERNAL_PATH,
);
} catch (error) {
console.error(`Error: ${error.message}`);
Expand Down
4 changes: 2 additions & 2 deletions packages/internal/core/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"commands": [
"nx run-many --target=setup",
"nx run-many --target=compose-build-image --projects=backend,workers",
"docker-compose up --force-recreate -d backend workers celery_default celery_beat"
"docker compose up --force-recreate -d backend workers celery_default celery_beat"
]
},
"dependsOn": ["setup"]
Expand All @@ -46,7 +46,7 @@
"options": {
"color": true,
"parallel": false,
"commands": ["docker-compose down"]
"commands": ["docker compose down"]
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This page contains a list of CLI commands that you can use within the `backend`

### `pnpm nx run backend:compose-build-image`

Builds a backend Docker image by running `docker-compose build backend`.
Builds a backend Docker image by running `docker compose build backend`.

<RunOnCICautionPartial />

Expand All @@ -19,7 +19,7 @@ Builds a backend Docker image by running `docker-compose build backend`.

### `pnpm nx run backend:test`

Runs tests (`scripts/run_tests.sh` script) inside Docker container using `docker-compose`.
Runs tests (`scripts/run_tests.sh` script) inside Docker container using `docker compose`.

---

Expand Down Expand Up @@ -61,7 +61,7 @@ Alias command for [`pnpm nx build`](#pnpm-nx-run-backendbuild).

### `pnpm saas backend shell`

Runs `bash` inside backend container: `docker-compose run --rm backend bash`
Runs `bash` inside backend container: `docker compose run --rm backend bash`

---

Expand Down
4 changes: 2 additions & 2 deletions packages/internal/docs/docs/api-reference/env-files.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ CNAME DNS records pointing to CloudFront distribution and Load Balancer need to
|--------------------------|----------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------|
| `PROJECT_NAME` | The name of your project (best if 3-5 characters to avoid AWS names being to long) | `saas` |
| `AWS_DEFAULT_REGION` | Default AWS region for you application | `eu-west-1` |
| `COMPOSE_PATH_SEPARATOR` | Check official `docker-compose` [documentation](https://docs.docker.com/compose/environment-variables/envvars/#compose_path_separator) | `:` |
| `COMPOSE_FILE` | Check official `docker-compose` [documentation](https://docs.docker.com/compose/environment-variables/envvars/#compose_file) | `docker-compose.yml:docker-compose.local.yml` |
| `COMPOSE_PATH_SEPARATOR` | Check official `docker compose` [documentation](https://docs.docker.com/compose/environment-variables/envvars/#compose_path_separator) | `:` |
| `COMPOSE_FILE` | Check official `docker compose` [documentation](https://docs.docker.com/compose/environment-variables/envvars/#compose_file) | `docker-compose.yml:docker-compose.local.yml` |
| `SB_HOSTED_ZONE_ID` | Id of a AWS Route53 hosted zone of a domain used to host services of this environment | `` |
| `SB_HOSTED_ZONE_NAME` | Name of a AWS Route53 hosted zone of a domain used to host services of this environment | `example.com` |
| `SB_DOMAIN_ADMIN_PANEL` | A domain used to host an admin panel service | `admin.example.com` |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import WSLNotice from '../../shared/partials/_wsl_notice.mdx';

### Start the app

This section provides instructions for running the <ProjectName/> locally on your machine. It covers three main areas: starting the local dev web server, starting the backend services using docker-compose, and (optionally) launching a local documentation instance based on Docusaurus.
This section provides instructions for running the <ProjectName/> locally on your machine. It covers three main areas: starting the local dev web server, starting the backend services using docker compose, and (optionally) launching a local documentation instance based on Docusaurus.

<WSLNotice />

#### Start backend

Project includes a set of backend services that can be run using docker-compose:
Project includes a set of backend services that can be run using docker compose:

```bash
pnpm nx run core:docker-compose:up
Expand Down
2 changes: 1 addition & 1 deletion packages/internal/ssm-editor/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"executor": "nx:run-commands",
"options": {
"color": true,
"command": "docker-compose build ssm-editor"
"command": "docker compose build ssm-editor"
}
}
},
Expand Down
12 changes: 6 additions & 6 deletions packages/workers/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"executor": "nx:run-commands",
"options": {
"color": true,
"commands": ["docker-compose build workers"],
"commands": ["docker compose build workers"],
"parallel": false
},
"dependsOn": ["setup"]
Expand All @@ -24,7 +24,7 @@
"options": {
"cwd": "packages/workers",
"color": true,
"command": "docker-compose run --rm workers /bin/bash"
"command": "docker compose run --rm workers /bin/bash"
},
"dependsOn": ["compose-build-image"]
},
Expand All @@ -41,7 +41,7 @@
"options": {
"color": true,
"commands": [
"docker-compose run --rm --entrypoint /bin/bash workers /app/packages/workers/scripts/runtime/run_deploy.sh",
"docker compose run --rm --entrypoint /bin/bash workers /app/packages/workers/scripts/runtime/run_deploy.sh",
"pnpm nx run tools:upload-service-version workers"
],
"parallel": false
Expand All @@ -53,7 +53,7 @@
"options": {
"color": true,
"commands": [
"docker-compose run --rm --no-deps --entrypoint /bin/bash workers /app/packages/workers/scripts/runtime/run_lint.sh",
"docker compose run --rm --no-deps --entrypoint /bin/bash workers /app/packages/workers/scripts/runtime/run_lint.sh",
"pnpm nx run workers:lint:js"
]
},
Expand All @@ -63,15 +63,15 @@
"executor": "nx:run-commands",
"options": {
"color": true,
"command": "docker-compose run --rm --entrypoint /bin/bash workers /app/packages/workers/scripts/runtime/run_tests.sh"
"command": "docker compose run --rm --entrypoint /bin/bash workers /app/packages/workers/scripts/runtime/run_tests.sh"
},
"dependsOn": ["compose-build-image"]
},
"build": {
"executor": "nx:run-commands",
"options": {
"color": true,
"command": "docker-compose run --rm --entrypoint /bin/bash workers /app/packages/workers/scripts/runtime/run_build.sh"
"command": "docker compose run --rm --entrypoint /bin/bash workers /app/packages/workers/scripts/runtime/run_build.sh"
},
"dependsOn": ["compose-build-image"]
}
Expand Down

0 comments on commit 26e3cf5

Please sign in to comment.