Skip to content

Commit

Permalink
refactor(docker): rm duplicate docker-compose.yml
Browse files Browse the repository at this point in the history
Motivation
----------
I strongly suggest to have one `docker-compose.yml` and one `docker-compose.override.yml` in a central directory, e.g. the root directory.

I don't see any good reason to scatter the files across sub-directories.
If you want to group services, use [profiles](https://docs.docker.com/compose/profiles/).

As a follow up, the different `README`s in each sub-directory needs to be updated. If this PR gets merged, I'm willing to do this.

How to test
-----------
1. Nothing to test.
  • Loading branch information
roschaefer committed Jul 2, 2024
1 parent e427708 commit 5fb3e9e
Show file tree
Hide file tree
Showing 19 changed files with 9 additions and 540 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/admin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,29 +44,24 @@ jobs:
name: Build Docker Production - Admin
needs: files-changed
runs-on: ubuntu-latest
env:
WORKING_DIRECTORY: ./admin
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Admin | Build Docker Production
run: docker compose -f docker-compose.yml build
run: docker compose -f docker-compose.yml build admin

docker-development:
if: needs.files-changed.outputs.admin == 'true'
name: Build Docker Development - Admin
needs: files-changed
runs-on: ubuntu-latest
env:
WORKING_DIRECTORY: ./admin
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Admin | Build Docker Development
run: docker compose build
working-directory: ${{env.WORKING_DIRECTORY}}
run: docker compose build admin admin-documentation admin-storybook

docs:
if: needs.files-changed.outputs.admin-docs == 'true'
Expand Down
10 changes: 2 additions & 8 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,30 +49,24 @@ jobs:
name: Build Docker Production - Backend
needs: files-changed
runs-on: ubuntu-latest
env:
WORKING_DIRECTORY: ./backend
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Backend | Build Docker Production
run: docker compose -f docker-compose.yml build
working-directory: ${{env.WORKING_DIRECTORY}}
run: docker compose -f docker-compose.yml build backend

docker-development:
if: needs.files-changed.outputs.backend == 'true'
name: Build Docker Development - Backend
needs: files-changed
runs-on: ubuntu-latest
env:
WORKING_DIRECTORY: ./backend
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Backend | Build Docker Development
run: docker compose build
working-directory: ${{env.WORKING_DIRECTORY}}
run: docker compose build backend backend-documentation

docs:
if: needs.files-changed.outputs.backend-docs == 'true'
Expand Down
10 changes: 2 additions & 8 deletions .github/workflows/frontend..yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,30 +44,24 @@ jobs:
name: Build Docker Production - Frontend
needs: files-changed
runs-on: ubuntu-latest
env:
WORKING_DIRECTORY: ./frontend
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Frontend | Build Docker Production
run: docker compose -f docker-compose.yml build
working-directory: ${{env.WORKING_DIRECTORY}}
run: docker compose -f docker-compose.yml build frontend

docker-development:
if: needs.files-changed.outputs.frontend == 'true'
name: Build Docker Development - Frontend
needs: files-changed
runs-on: ubuntu-latest
env:
WORKING_DIRECTORY: ./frontend
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Frontend | Build Docker Development
run: docker compose build
working-directory: ${{env.WORKING_DIRECTORY}}
run: docker compose build frontend frontend-documentation frontend-storybook

docs:
if: needs.files-changed.outputs.frontend-docs == 'true'
Expand Down
10 changes: 2 additions & 8 deletions .github/workflows/presenter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,30 +44,24 @@ jobs:
name: Build Docker Production - Presenter
needs: files-changed
runs-on: ubuntu-latest
env:
WORKING_DIRECTORY: ./presenter
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Presenter | Build Docker Production
run: docker compose -f docker-compose.yml build
working-directory: ${{env.WORKING_DIRECTORY}}
run: docker compose -f docker-compose.yml build presenter

docker-development:
if: needs.files-changed.outputs.presenter == 'true'
name: Build Docker Development - Presenter
needs: files-changed
runs-on: ubuntu-latest
env:
WORKING_DIRECTORY: ./presenter
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Presenter | Build Docker Development
run: docker compose build
working-directory: ${{env.WORKING_DIRECTORY}}
run: docker compose build presenter presenter-documentation presenter-storybook

docs:
if: needs.files-changed.outputs.presenter-docs == 'true'
Expand Down
14 changes: 0 additions & 14 deletions admin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,20 +67,6 @@ This projects utilizes `storybook` and `chromatic` to develop, document & test f
| **Maintenance** | |
| `npm run update` | Check for updates |

### Docker

### Docker development mode

```bash
docker compose up
```

### Docker can be run in production mode

```bash
docker compose -f docker-compose.yml up
```

### Chromatic

In order to use the chromatic workflow you need to provide a `CHROMATIC_PROJECT_TOKEN` in the repository secrets.
Expand Down
63 changes: 0 additions & 63 deletions admin/docker-compose.override.yml

This file was deleted.

28 changes: 0 additions & 28 deletions admin/docker-compose.yml

This file was deleted.

12 changes: 0 additions & 12 deletions backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,6 @@ The following commands are available:
| **Maintenance** | |
| `npm run update` | Check for updates |

### Docker

Docker can be run in development mode utilizing `docker-compose.overwrite.yml`:
```bash
docker compose up
```

Docker can be run in production mode:
```bash
docker compose -f docker-compose.yml up
```

### Update

You can get a list of packes to update by running `npm run update`.
Expand Down
40 changes: 0 additions & 40 deletions backend/docker-compose.override.yml

This file was deleted.

28 changes: 0 additions & 28 deletions backend/docker-compose.yml

This file was deleted.

12 changes: 0 additions & 12 deletions frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,6 @@ The following commands are available:
| **Maintenance** | |
| `npm run update` | Check for updates |

### Docker

Docker can be run in development mode utilizing `docker-compose.overwrite.yml`:
```bash
docker compose up
```

Docker can be run in production mode:
```bash
docker compose -f docker-compose.yml up
```

### Chromatic

In order to use the chromatic workflow you need to provide a `CHROMATIC_PROJECT_TOKEN` in the repository secrets.
Expand Down
Loading

0 comments on commit 5fb3e9e

Please sign in to comment.