Skip to content

Commit c954906

Browse files
committed
Updated itkdev docker templates
1 parent 73dad17 commit c954906

21 files changed

Lines changed: 560 additions & 62 deletions

.docker/data/.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Ignore everything in this directory
22
*
3-
# Except this file
3+
# Except
44
!.gitignore
5-
!Readme.md
5+
!README.md

.docker/nginx.conf

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ http {
1717
include /etc/nginx/mime.types;
1818
default_type application/octet-stream;
1919

20-
set_real_ip_from 172.16.0.0/16;
21-
real_ip_recursive on;
22-
real_ip_header X-Forwarded-For;
20+
# Note: set_real_ip_from is set in the server block
2321

2422
log_format main '$http_x_real_ip - $remote_user [$time_local] "$request" '
2523
'$status $body_bytes_sent "$http_referer" '

.docker/templates/default.conf.template

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,20 @@ server {
66

77
client_max_body_size ${NGINX_MAX_BODY_SIZE};
88

9-
# This also needs to be set in the single server tag and not only in http.
109
set_real_ip_from 172.16.0.0/16;
10+
set_real_ip_from 192.168.39.0/24;
1111
real_ip_recursive on;
1212
real_ip_header X-Forwarded-For;
1313

14+
location = /cron-metrics {
15+
# Proxy to supercronic metrics
16+
proxy_pass http://${NGINX_CRON_METRICS}/metrics;
17+
proxy_set_header Host $host;
18+
proxy_set_header X-Real-IP $remote_addr;
19+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
20+
proxy_set_header X-Forwarded-Proto $scheme;
21+
}
22+
1423
location / {
1524
# try to serve file directly, fallback to index.php
1625
try_files $uri /index.php$is_args$args;

.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
COMPOSE_PROJECT_NAME=itksites
2-
#COMPOSE_DOMAIN=itksites.local.itkdev.dk
3-
COMPOSE_DOMAIN=sites.itkdev.dk
2+
COMPOSE_DOMAIN=itksites.local.itkdev.dk
3+
ITKDEV_TEMPLATE=symfony-8
44

55
# In all environments, the following files are loaded if they exist,
66
# the latter taking precedence over the former:

.github/workflows/changelog.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Do not edit this file! Make a pull request on changing
2+
# github/workflows/changelog.yaml in
3+
# https://github.com/itk-dev/devops_itkdev-docker if need be.
4+
5+
### ### Changelog
6+
###
7+
### Checks that changelog has been updated
8+
9+
name: Changelog
10+
11+
on:
12+
pull_request:
13+
14+
jobs:
15+
changelog:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v6
20+
with:
21+
fetch-depth: 2
22+
23+
- name: Git fetch
24+
run: git fetch
25+
26+
- name: Check that changelog has been updated.
27+
run: git diff --exit-code origin/${{ github.base_ref }} -- CHANGELOG.md && exit 1 || exit 0

.github/workflows/composer.yaml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Do not edit this file! Make a pull request on changing
2+
# github/workflows/composer.yaml in
3+
# https://github.com/itk-dev/devops_itkdev-docker if need be.
4+
5+
### ### Composer
6+
###
7+
### Validates composer.json and checks that it's normalized.
8+
###
9+
### #### Assumptions
10+
###
11+
### 1. A docker compose service named `phpfpm` can be run and `composer` can be
12+
### run inside the `phpfpm` service.
13+
### 2. [ergebnis/composer-normalize](https://github.com/ergebnis/composer-normalize)
14+
### is a dev requirement in `composer.json`:
15+
###
16+
### ``` shell
17+
### docker compose run --rm phpfpm composer require --dev ergebnis/composer-normalize
18+
### ```
19+
###
20+
### Normalize `composer.json` by running
21+
###
22+
### ``` shell
23+
### docker compose run --rm phpfpm composer normalize
24+
### ```
25+
26+
name: Composer
27+
28+
env:
29+
COMPOSE_USER: runner
30+
31+
on:
32+
pull_request:
33+
paths: &paths
34+
- "composer.json"
35+
- "composer.lock"
36+
- "docker-compose.yml"
37+
push:
38+
branches:
39+
- main
40+
- develop
41+
paths: *paths
42+
43+
jobs:
44+
composer-validate:
45+
runs-on: ubuntu-latest
46+
steps:
47+
- uses: actions/checkout@v6
48+
49+
- name: Create docker network
50+
run: |
51+
docker network create frontend
52+
53+
- run: |
54+
docker compose run --rm phpfpm composer validate --strict
55+
56+
composer-normalized:
57+
runs-on: ubuntu-latest
58+
steps:
59+
- uses: actions/checkout@v6
60+
61+
- name: Create docker network
62+
run: |
63+
docker network create frontend
64+
65+
- run: |
66+
docker compose run --rm phpfpm composer install
67+
docker compose run --rm phpfpm composer normalize --dry-run
68+
69+
composer-audit:
70+
runs-on: ubuntu-latest
71+
steps:
72+
- uses: actions/checkout@v6
73+
74+
- name: Create docker network
75+
run: |
76+
docker network create frontend
77+
78+
- run: |
79+
docker compose run --rm phpfpm composer audit

.github/workflows/javascript.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Do not edit this file! Make a pull request on changing
2+
# github/workflows/symfony/javascript.yaml in
3+
# https://github.com/itk-dev/devops_itkdev-docker if need be.
4+
5+
### ### Symfony JavaScript (and TypeScript)
6+
###
7+
### Validates JavaScript files.
8+
###
9+
### #### Assumptions
10+
###
11+
### 1. A docker compose service named `prettier` for running
12+
### [Prettier](https://prettier.io/) exists.
13+
14+
name: JavaScript
15+
16+
on:
17+
pull_request:
18+
paths: &paths
19+
- "assets/**/*.js"
20+
- "docker-compose.yml"
21+
push:
22+
branches:
23+
- main
24+
- develop
25+
paths: *paths
26+
27+
jobs:
28+
javascript-lint:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Checkout
32+
uses: actions/checkout@v6
33+
34+
- name: Create docker network
35+
run: |
36+
docker network create frontend
37+
38+
- run: |
39+
docker compose run --rm prettier 'assets/**/*.js' --check

.github/workflows/markdown.yaml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Do not edit this file! Make a pull request on changing
2+
# github/workflows/markdown.yaml in
3+
# https://github.com/itk-dev/devops_itkdev-docker if need be.
4+
5+
### ### Markdown
6+
###
7+
### Lints Markdown files (`**/*.md`) in the project.
8+
###
9+
### [markdownlint-cli configuration
10+
### files](https://github.com/igorshubovych/markdownlint-cli?tab=readme-ov-file#configuration),
11+
### `.markdownlint.jsonc` and `.markdownlintignore`, control what is actually
12+
### linted and how.
13+
###
14+
### #### Assumptions
15+
###
16+
### 1. A docker compose service named `markdownlint` for running `markdownlint`
17+
### (from
18+
### [markdownlint-cli](https://github.com/igorshubovych/markdownlint-cli))
19+
### exists.
20+
21+
name: Markdown
22+
23+
on:
24+
pull_request:
25+
paths: &paths
26+
- "**/*.md"
27+
push:
28+
branches:
29+
- main
30+
- develop
31+
paths: *paths
32+
33+
jobs:
34+
markdown-lint:
35+
runs-on: ubuntu-latest
36+
steps:
37+
- name: Checkout
38+
uses: actions/checkout@v6
39+
40+
- name: Create docker network
41+
run: |
42+
docker network create frontend
43+
44+
- run: |
45+
docker compose run --rm markdownlint markdownlint '**/*.md'

.github/workflows/php.yaml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Do not edit this file! Make a pull request on changing
2+
# github/workflows/symfony/php.yaml in
3+
# https://github.com/itk-dev/devops_itkdev-docker if need be.
4+
5+
### ### Symfony PHP
6+
###
7+
### Checks that PHP code adheres to the [Symfony coding
8+
### standards](https://symfony.com/doc/current/contributing/code/standards.html).
9+
###
10+
### #### Assumptions
11+
###
12+
### 1. A docker compose service named `phpfpm` can be run and `composer` can be
13+
### run inside the `phpfpm` service. 2.
14+
### [friendsofphp/php-cs-fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer)
15+
### is a dev requirement in `composer.json`:
16+
###
17+
### ``` shell
18+
### docker compose run --rm phpfpm composer require --dev friendsofphp/php-cs-fixer
19+
### ```
20+
###
21+
### Clean up and check code by running
22+
###
23+
### ``` shell
24+
### docker compose run --rm phpfpm vendor/bin/php-cs-fixer fix
25+
### docker compose run --rm phpfpm vendor/bin/php-cs-fixer fix --dry-run --diff
26+
### ```
27+
###
28+
### > [!NOTE] The template adds `.php-cs-fixer.dist.php` as [a configuration
29+
### > file for PHP CS
30+
### > Fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/doc/config.rst)
31+
### > and this makes it possible to override the actual configuration used in a
32+
### > project by adding a more important configuration file, `.php-cs-fixer.php`.
33+
34+
name: Symfony PHP
35+
36+
env:
37+
COMPOSE_USER: runner
38+
39+
on:
40+
pull_request:
41+
paths: &paths
42+
- "**/*.php"
43+
- "composer.json"
44+
- "composer.lock"
45+
- "docker-compose.yml"
46+
push:
47+
branches:
48+
- main
49+
- develop
50+
paths: *paths
51+
52+
jobs:
53+
coding-standards:
54+
name: PHP - Check Coding Standards
55+
runs-on: ubuntu-latest
56+
steps:
57+
- uses: actions/checkout@v6
58+
59+
- name: Create docker network
60+
run: |
61+
docker network create frontend
62+
63+
- run: |
64+
docker compose run --rm phpfpm composer install
65+
# https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/doc/usage.rst#the-check-command
66+
docker compose run --rm phpfpm vendor/bin/php-cs-fixer fix --dry-run --diff

.github/workflows/styles.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Do not edit this file! Make a pull request on changing
2+
# github/workflows/symfony/styles.yaml in
3+
# https://github.com/itk-dev/devops_itkdev-docker if need be.
4+
5+
### ### Symfony Styles (CSS and SCSS)
6+
###
7+
### Validates styles files.
8+
###
9+
### #### Assumptions
10+
###
11+
### 1. A docker compose service named `prettier` for running
12+
### [Prettier](https://prettier.io/) exists.
13+
14+
name: Styles
15+
16+
on:
17+
pull_request:
18+
paths: &paths
19+
- "assets/**/*.css"
20+
- "assets/**/*.scss"
21+
- "docker-compose.yml"
22+
push:
23+
branches:
24+
- main
25+
- develop
26+
paths: *paths
27+
28+
jobs:
29+
styles-lint:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v6
34+
35+
- name: Create docker network
36+
run: |
37+
docker network create frontend
38+
39+
- run: |
40+
docker compose run --rm prettier 'assets/**/*.{css,scss}' --check

0 commit comments

Comments
 (0)