Skip to content

Commit acec6d7

Browse files
committed
Added ITKDev project template
1 parent d97f3da commit acec6d7

39 files changed

Lines changed: 864 additions & 64 deletions

.ddev/docker-compose.scorpio.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
networks:
2-
scorpio:
2+
scorpio:
33

44
# https://docs.ddev.com/en/stable/users/extend/custom-docker-services/
55
services:

.docker/data/.gitignore

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

.docker/data/README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# .docker/data
2+
3+
Please map persistent volumes to this directory on the servers.
4+
5+
If a container needs to persist data between restarts you can map the relevant files in the container to ``docker/data/<container-name>`.
6+
7+
## RabbitMQ example
8+
If you are using RabbitMQ running in a container as a message broker you need to configure a persistent volume for RabbitMQs data directory to avoid losing message on container restarts.
9+
10+
```yaml
11+
# docker-compose.server.override.yml
12+
13+
services:
14+
rabbit:
15+
image: rabbitmq:3.9-management-alpine
16+
hostname: "${COMPOSE_PROJECT_NAME}"
17+
networks:
18+
- app
19+
- frontend
20+
environment:
21+
- "RABBITMQ_DEFAULT_USER=${RABBITMQ_USER}"
22+
- "RABBITMQ_DEFAULT_PASS=${RABBITMQ_PASSWORD}"
23+
- "RABBITMQ_ERLANG_COOKIE=${RABBITMQ_ERLANG_COOKIE}"
24+
volumes:
25+
- ".docker/data/rabbitmq:/var/lib/rabbitmq/mnesia/"
26+
```

.docker/nginx.conf

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
worker_processes auto;
2+
3+
error_log /dev/stderr notice;
4+
pid /tmp/nginx.pid;
5+
6+
events {
7+
worker_connections 1024;
8+
}
9+
10+
http {
11+
proxy_temp_path /tmp/proxy_temp;
12+
client_body_temp_path /tmp/client_temp;
13+
fastcgi_temp_path /tmp/fastcgi_temp;
14+
uwsgi_temp_path /tmp/uwsgi_temp;
15+
scgi_temp_path /tmp/scgi_temp;
16+
17+
include /etc/nginx/mime.types;
18+
default_type application/octet-stream;
19+
20+
# Note: set_real_ip_from is set in the server block
21+
22+
log_format main '$http_x_real_ip - $remote_user [$time_local] "$request" '
23+
'$status $body_bytes_sent "$http_referer" '
24+
'"$http_user_agent" "$http_x_forwarded_for"';
25+
26+
access_log /dev/stdout main;
27+
28+
sendfile on;
29+
keepalive_timeout 65;
30+
31+
gzip on;
32+
33+
include /etc/nginx/conf.d/*.conf;
34+
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
server {
2+
listen ${NGINX_PORT};
3+
server_name localhost;
4+
5+
root ${NGINX_WEB_ROOT};
6+
7+
client_max_body_size ${NGINX_MAX_BODY_SIZE};
8+
9+
set_real_ip_from 172.16.0.0/16;
10+
set_real_ip_from 192.168.39.0/24;
11+
real_ip_recursive on;
12+
real_ip_header X-Forwarded-For;
13+
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+
23+
location / {
24+
# try to serve file directly, fallback to index.php
25+
try_files $uri /index.php$is_args$args;
26+
}
27+
28+
# Protect files and directories from prying eyes.
29+
location ~* \.(engine|inc|install|make|module|profile|po|sh|.*sql|.tar|.gz|.bz2|theme|twig|tpl(\.php)?|xtmpl|yml)(~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\.(?!well-known).*|Entries.*|Repository|Root|Tag|Template|composer\.(json|lock)|web\.config)$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig|\.save)$ {
30+
deny all;
31+
return 404;
32+
}
33+
34+
location ~ ^/index\.php(/|$) {
35+
fastcgi_buffers 16 32k;
36+
fastcgi_buffer_size 64k;
37+
fastcgi_busy_buffers_size 64k;
38+
39+
fastcgi_pass ${NGINX_FPM_SERVICE};
40+
fastcgi_split_path_info ^(.+\.php)(/.*)$;
41+
include fastcgi_params;
42+
43+
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
44+
fastcgi_param DOCUMENT_ROOT $realpath_root;
45+
46+
internal;
47+
}
48+
49+
location ~ \.php$ {
50+
return 404;
51+
}
52+
53+
# Send log message to files symlinked to stdout/stderr.
54+
error_log /dev/stderr;
55+
access_log /dev/stdout main;
56+
}

.env

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
COMPOSE_PROJECT_NAME=enter
2+
COMPOSE_DOMAIN=enter.local.itkdev.dk
3+
ITKDEV_TEMPLATE=symfony-8
4+
15
# In all environments, the following files are loaded if they exist,
26
# the latter taking precedence over the former:
37
#

.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@v7
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@v7
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@v7
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@v7
73+
74+
- name: Create docker network
75+
run: |
76+
docker network create frontend
77+
78+
- run: |
79+
docker compose run --rm phpfpm composer audit --locked

.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@v7
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@v7
39+
40+
- name: Create docker network
41+
run: |
42+
docker network create frontend
43+
44+
- run: |
45+
docker compose run --rm markdownlint markdownlint '**/*.md'

0 commit comments

Comments
 (0)