Skip to content

Commit 80a4771

Browse files
committed
Update symfony
1 parent 7315dc4 commit 80a4771

File tree

117 files changed

+2508
-7465
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+2508
-7465
lines changed

.dockerignore

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
**/*.log
2+
**/*.md
3+
**/*.php~
4+
**/*.dist.php
5+
**/*.dist
6+
**/*.cache
7+
**/._*
8+
**/.dockerignore
9+
**/.DS_Store
10+
**/.git/
11+
**/.gitattributes
12+
**/.gitignore
13+
**/.gitmodules
14+
**/compose.*.yaml
15+
**/compose.*.yml
16+
**/compose.yaml
17+
**/compose.yml
18+
**/docker-compose.*.yaml
19+
**/docker-compose.*.yml
20+
**/docker-compose.yaml
21+
**/docker-compose.yml
22+
**/Dockerfile
23+
**/Thumbs.db
24+
.github/
25+
docs/
26+
public/bundles/
27+
tests/
28+
var/
29+
vendor/
30+
.editorconfig
31+
.env.*.local
32+
.env.local
33+
.env.local.php
34+
.env.test

.editorconfig

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# EditorConfig helps developers define and maintain consistent
2+
# coding styles between different editors and IDEs
3+
# editorconfig.org
4+
5+
root = true
6+
7+
[*]
8+
# Change these settings to your own preference
9+
indent_style = space
10+
indent_size = 4
11+
12+
# We recommend you to keep these unchanged
13+
end_of_line = lf
14+
charset = utf-8
15+
trim_trailing_whitespace = true
16+
insert_final_newline = true
17+
18+
[*.{js,html,ts,tsx}]
19+
indent_size = 2
20+
21+
[*.json]
22+
indent_size = 2
23+
24+
[*.md]
25+
trim_trailing_whitespace = false
26+
27+
[*.sh]
28+
indent_style = tab
29+
30+
[*.xml{,.dist}]
31+
indent_style = space
32+
indent_size = 4
33+
34+
[*.{yaml,yml}]
35+
trim_trailing_whitespace = false
36+
37+
[.github/workflows/*.yml]
38+
indent_size = 2
39+
40+
[.gitmodules]
41+
indent_style = tab
42+
43+
[.php_cs{,.dist}]
44+
indent_style = space
45+
indent_size = 4
46+
47+
[composer.json]
48+
indent_size = 4
49+
50+
[{,docker-}compose{,.*}.{yaml,yml}]
51+
indent_style = space
52+
indent_size = 2
53+
54+
[{,*.*}Dockerfile]
55+
indent_style = tab
56+
57+
[{,*.*}Caddyfile]
58+
indent_style = tab

.env

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# In all environments, the following files are loaded if they exist,
2-
# the later taking precedence over the former:
2+
# the latter taking precedence over the former:
33
#
44
# * .env contains default values for the environment variables needed by the app
55
# * .env.local uncommitted file with local overrides
@@ -9,27 +9,12 @@
99
# Real environment variables win over .env files.
1010
#
1111
# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES.
12+
# https://symfony.com/doc/current/configuration/secrets.html
1213
#
1314
# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2).
14-
# https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration
15+
# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration
1516

1617
###> symfony/framework-bundle ###
1718
APP_ENV=dev
18-
APP_SECRET='s$cretf0rt3st'
19-
#TRUSTED_PROXIES=127.0.0.1,127.0.0.2
20-
#TRUSTED_HOSTS='^localhost|example\.com$'
19+
APP_SECRET=changeme
2120
###< symfony/framework-bundle ###
22-
23-
###> doctrine/doctrine-bundle ###
24-
# Format described at http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
25-
# For an SQLite database, use: "sqlite:///%kernel.project_dir%/var/data.db"
26-
# Configure your db driver and server_version in config/packages/doctrine.yaml
27-
DATABASE_URL=mysql://db_user:[email protected]:3306/db_name
28-
###< doctrine/doctrine-bundle ###
29-
30-
###> symfony/swiftmailer-bundle ###
31-
# For Gmail as a transport, use: "gmail://username:password@localhost"
32-
# For a generic SMTP server, use: "smtp://localhost:25?encryption=&auth_mode="
33-
# Delivery is disabled by default via "null://localhost"
34-
MAILER_URL=null://localhost
35-
###< symfony/swiftmailer-bundle ###

.env.dev

Lines changed: 0 additions & 4 deletions
This file was deleted.

.env.test

Lines changed: 0 additions & 4 deletions
This file was deleted.

.gitattributes

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
* text=auto eol=lf
2+
3+
*.conf text eol=lf
4+
*.html text eol=lf
5+
*.ini text eol=lf
6+
*.js text eol=lf
7+
*.json text eol=lf
8+
*.md text eol=lf
9+
*.php text eol=lf
10+
*.sh text eol=lf
11+
*.yaml text eol=lf
12+
*.yml text eol=lf
13+
bin/console text eol=lf
14+
composer.lock text eol=lf merge=ours
15+
16+
*.ico binary
17+
*.png binary

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
###> symfony/framework-bundle ###
3+
/.env.local
4+
/.env.local.php
5+
/.env.*.local
6+
/config/secrets/prod/prod.decrypt.private.php
7+
/public/bundles/
8+
/var/
9+
/vendor/
10+
###< symfony/framework-bundle ###

CODE_OF_CONDUCT.md

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,19 @@
11
# Code of Conduct
22

3-
In this open-source project, our aim is to foster a welcoming and inclusive environment. We expect all contributors
4-
and participants interact with each other with courtesy, respect and kindness.
3+
## Welcome to Our Open-Source Community
54

6-
We will not tolerate abuse or harassment of any kind.
5+
This collaborative project strives to create an inclusive and welcoming environment. We value all contributors' and participants' interactions that reflect courtesy, respect, and kindness.
76

8-
In the event of a concern about behaviour, please contact the maintainers of the project:
7+
We have a zero-tolerance policy for any form of abuse or harassment.
98

10-
* Dennis Schwertel <dennis.swchwertel@divio.com>
9+
If you have concerns about behaviour, please reach out to Divio at info@divio.com.
1110

12-
Reports will be taken seriously and treated in confidence. If necessary, the maintainers will act to exclude
13-
individuals from participating in this and other projects.
11+
Reports will be treated confidentially and taken seriously. The project maintainers may take appropriate action, including exclusion from participation in this and other projects, if necessary.
1412

13+
## Guidelines for Code Review
1514

16-
## Code review
15+
Code review is a crucial but sometimes challenging process for contributors and reviewers. It involves constructive critique, and improvements are often needed before accepting contributions.
1716

18-
Code review can be a frustrating process for both contributors and reviewers, with many opportunities for mutual
19-
misunderstanding.
17+
We expect contributors to recognize that all aspects of their submissions, including code and underlying ideas, will be carefully reviewed.
2018

21-
We expect participants who submit contributions for review to understand and accept that all contributions to the
22-
project, including code and the ideas behind it, will be reviewed carefully. Often review will include critique and
23-
criticism, and will almost always require improvements or other changes before contributions can be accepted.
24-
25-
We also expect reviewers to communicate sensitively and respectfully.
26-
27-
This is in line with a shared aim for the success of the project.
19+
Reviewers are encouraged to provide feedback sensitively and respectfully, aligning with our shared goal for the project's success.

CONTRIBUTING.md

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,26 @@
1-
# How to contribute to the project
1+
# Contributing to the Project
22

3-
Thanks for contributing, welcome aboard.
3+
Thank you for contributing! We appreciate your involvement in making this project better. Before you start, please familiarize yourself with our [Code of Conduct](./CODE_OF_CONDUCT.md).
44

5-
Please see our [CODE OF CONDUCT](./CODE_OF_CONDUCT.md) for our code of conduct.
5+
## Submitting Proposals
66

7+
Proposals can be submitted through:
78

8-
## Submitting proposals
9+
- [Pull Requests](https://github.com/divio/getting-started-with-symfony/pulls)
10+
- [Issues](https://github.com/divio/getting-started-with-symfony/issues)
911

10-
Please provide proposals as
11-
[pull requests](https://github.com/flavours/getting-started-with-spring-boot/pulls)
12-
or
13-
[issues](https://github.com/flavours/getting-started-with-spring-boot/issues) as appropriate.
12+
## Pull Requests and Branches
1413

14+
When making pull requests, adhere to the following:
1515

16-
## Pull requests and branches
16+
- Submit from a properly named new branch.
17+
- Target the `main` branch.
1718

18-
Please make pull requests:
19-
20-
* from an appropriately-named new branch
21-
* to the ``main`` branch
22-
23-
See:
24-
25-
* [how to make pull requests](https://help.github.com/articles/using-pull-requests/)
26-
* [how to manage branches](https://help.github.com/articles/creating-and-deleting-branches-within-your-repository/)
19+
Learn more:
2720

21+
- [How to make pull requests](https://help.github.com/articles/using-pull-requests/)
22+
- [Managing branches](https://help.github.com/articles/creating-and-deleting-branches-within-your-repository/)
2823

2924
### Whitespace
3025

31-
Do not use trailing whitespace (spaces or tabs at the end of a line). They are often not visible, and can cause silent
32-
problems and misleading unexpected changes. For example, some editors quietly delete them by default.
26+
Avoid trailing whitespace (spaces or tabs at the end of a line). They might be invisible and lead to silent issues or unexpected changes. Some editors may silently delete them by default.

Dockerfile

Lines changed: 99 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,103 @@
1-
FROM divio/base:0.1-php7.3-stretch
2-
EXPOSE 80
3-
4-
COPY migrate.sh Procfile /app/
5-
COPY divio/*.php divio/*.sh /app/divio/
6-
COPY start.sh /usr/local/bin/start
7-
8-
RUN echo '[www]\nclear_env = no\ncatch_workers_output = yes' > /usr/local/etc/php-fpm.d/zz-divio.conf
9-
RUN echo 'auto_prepend_file="/app/divio/rewrite-env.php"' > /usr/local/etc/php/conf.d/divio-conf.ini
10-
RUN chmod a+x /usr/local/bin/start /app/*.sh
11-
12-
ENV NODE_VERSION=12.9.1 \
13-
NPM_VERSION=6.10.2
14-
RUN bash -c "source $NVM_DIR/nvm.sh && \
15-
nvm install $NODE_VERSION && \
16-
nvm alias default $NODE_VERSION && \
17-
nvm use default && \
18-
npm install -g npm@$NPM_VERSION && \
19-
npm cache clear --force"
20-
ENV NODE_PATH=$NVM_DIR/versions/node/v$NODE_VERSION/lib/node_modules \
21-
PATH=$NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH
22-
23-
COPY divio/nginx/vhost.conf /etc/nginx/sites-available/default
24-
COPY divio/php/php-fpm.conf /usr/local/etc/php-fpm.conf
25-
26-
COPY composer.* /app/
27-
RUN cd /app && composer install --no-scripts
1+
#syntax=docker/dockerfile:1.4
2+
3+
# Versions
4+
FROM dunglas/frankenphp:1-alpine AS frankenphp_upstream
5+
6+
# The different stages of this Dockerfile are meant to be built into separate images
7+
# https://docs.docker.com/develop/develop-images/multistage-build/#stop-at-a-specific-build-stage
8+
# https://docs.docker.com/compose/compose-file/#target
9+
10+
11+
# Base FrankenPHP image
12+
FROM frankenphp_upstream AS frankenphp_base
2813

2914
WORKDIR /app
30-
COPY . /app
3115

32-
RUN cd /app && composer run-script post-install-cmd && composer auto-scripts
16+
# persistent / runtime deps
17+
# hadolint ignore=DL3018
18+
RUN apk add --no-cache \
19+
acl \
20+
file \
21+
gettext \
22+
git \
23+
;
24+
25+
RUN set -eux; \
26+
install-php-extensions \
27+
@composer \
28+
apcu \
29+
intl \
30+
opcache \
31+
zip \
32+
;
33+
34+
# https://getcomposer.org/doc/03-cli.md#composer-allow-superuser
35+
ENV COMPOSER_ALLOW_SUPERUSER=1
36+
37+
###> recipes ###
38+
###< recipes ###
39+
40+
COPY --link frankenphp/conf.d/app.ini $PHP_INI_DIR/conf.d/
41+
COPY --link frankenphp/docker-entrypoint.sh /usr/local/bin/docker-entrypoint
42+
COPY --link frankenphp/Caddyfile /etc/caddy/Caddyfile
43+
RUN chmod 755 /usr/local/bin/docker-entrypoint
44+
45+
ENTRYPOINT ["docker-entrypoint"]
46+
47+
HEALTHCHECK --start-period=60s CMD curl -f http://localhost:2019/metrics || exit 1
48+
49+
CMD [ "frankenphp", "run", "--config", "/etc/caddy/Caddyfile" ]
50+
51+
# Dev FrankenPHP image
52+
FROM frankenphp_base AS frankenphp_dev
53+
54+
ENV APP_ENV=dev XDEBUG_MODE=off
55+
VOLUME /app/var/
56+
57+
RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"
58+
59+
RUN set -eux; \
60+
install-php-extensions \
61+
xdebug \
62+
;
63+
64+
COPY --link frankenphp/conf.d/app.dev.ini $PHP_INI_DIR/conf.d/
65+
66+
CMD [ "frankenphp", "run", "--config", "/etc/caddy/Caddyfile", "--watch" ]
67+
68+
# Prod FrankenPHP image
69+
FROM frankenphp_base AS frankenphp_prod
70+
71+
ENV APP_ENV=prod
72+
ENV FRANKENPHP_CONFIG="import worker.Caddyfile"
73+
74+
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
75+
76+
COPY --link frankenphp/conf.d/app.prod.ini $PHP_INI_DIR/conf.d/
77+
COPY --link frankenphp/worker.Caddyfile /etc/caddy/worker.Caddyfile
78+
79+
# prevent the reinstallation of vendors at every changes in the source code
80+
COPY --link composer.* symfony.* ./
81+
RUN set -eux; \
82+
composer install --no-cache --prefer-dist --no-dev --no-autoloader --no-scripts --no-progress
83+
84+
# copy sources
85+
COPY --link . ./
86+
RUN rm -Rf frankenphp/
87+
88+
RUN set -eux; \
89+
mkdir -p var/cache var/log; \
90+
composer dump-autoload --classmap-authoritative --no-dev; \
91+
composer dump-env prod; \
92+
composer run-script --no-dev post-install-cmd; \
93+
chmod +x bin/console; sync;
94+
95+
# Run on Divio Cloud
96+
FROM frankenphp_dev
97+
98+
ENV SERVER_NAME=:80
99+
ENV STABILITY=stable
100+
ENV MERCURE_PUBLISHER_JWT_KEY=changeme
101+
ENV MERCURE_SUBSCRIBER_JWT_KEY=changeme
33102

34-
ENTRYPOINT [ "" ]
35-
CMD ["start", "web"]
103+
COPY . /app/

0 commit comments

Comments
 (0)