Skip to content

Commit bca63d2

Browse files
init
1 parent 76424a1 commit bca63d2

28 files changed

+1073
-318
lines changed

Diff for: .env

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ APP_SECRET=03f6994ac87aecede000de1509cb1af1
2424
#
2525
# DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db"
2626
# DATABASE_URL="mysql://db_user:[email protected]:3306/db_name?serverVersion=5.7"
27-
DATABASE_URL="postgresql://db_user:[email protected]:5432/db_name?serverVersion=13&charset=utf8"
27+
DATABASE_URL=postgres://sf_user:random_password@postgres/test
2828
###< doctrine/doctrine-bundle ###

Diff for: .github/FUNDING.yml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# These are supported funding model platforms
2+
3+
patreon: capcoding

Diff for: Dockerfile

+8-3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ ARG WORKDIR=/app
77

88
RUN docker-php-source extract \
99
&& apk add --update --virtual .build-deps autoconf g++ make pcre-dev icu-dev openssl-dev libxml2-dev libmcrypt-dev git libpng-dev \
10+
# Install pgsql goodness
11+
&& apk add postgresql-dev \
12+
&& docker-php-ext-install pgsql pdo_pgsql \
13+
&& apk del postgresql-libs libsasl db \
1014
# Instaling pecl modules
1115
&& pecl install apcu xdebug \
1216
# Enable pecl modules
@@ -39,18 +43,19 @@ WORKDIR ${WORKDIR}
3943
# prevent the reinstallation of vendors at every changes in the source code
4044
COPY composer.json composer.lock symfony.lock ./
4145
RUN set -eux; \
42-
composer install --prefer-dist --no-autoloader --no-scripts --no-progress --no-suggest; \
46+
composer install --prefer-dist --no-autoloader --no-scripts --no-progress; \
4347
composer clear-cache
4448

4549
RUN set -eux \
4650
&& mkdir -p var/cache var/log \
4751
&& composer dump-autoload --classmap-authoritative
4852

49-
VOLUME ${WORKDIR}/var
50-
5153
COPY docker/php/docker-entrypoint.sh /usr/local/bin/docker-entrypoint
5254
RUN chmod +x /usr/local/bin/docker-entrypoint
5355

56+
RUN chown www-data:www-data -R ${WORKDIR}/var/*
57+
USER www-data
58+
5459
ENTRYPOINT ["docker-entrypoint"]
5560
CMD ["php-fpm"]
5661

Diff for: Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
up:
22
docker-compose up -d
3+
docker-compose exec php ./bin/console doctrine:migrations:migrate -n
34

45
down:
56
docker-compose down -v

Diff for: README.md

+13-8
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,31 @@
1-
# Design pattern "Chain of responsibility" (Symfony implementation)
1+
# Delay "heavy" tasks in Symfony with event kernel.terminate
22

3-
Watch full tutorial [here](https://youtu.be/3KQlubIv684)
3+
Watch full tutorial [here](https://youtu.be/HrQme9KUlUg)
44

5-
# Launch project
5+
## Launch project
66

77
Run in terminal `make up`
88

9-
Sample API request:
9+
### Sample API request:
1010

1111
```
12-
curl --location --request POST 'http://localhost:8080/api/locations/resolve' \
13-
--header 'content-type: application/json' \
12+
curl --location --request POST 'http://localhost:8080/api/v1/reservations' \
13+
--header 'Content-Type: application/json' \
1414
--data-raw '{
15-
"name": "My closest gym"
15+
"name": "some reservation",
16+
"price": 200
1617
}'
1718
```
1819

1920
# Other video tutorials
2021

22+
## Design pattern "Chain of responsibility" (Symfony implementation)
23+
24+
There is a [video](https://youtu.be/3KQlubIv684)
25+
2126
## Create Symfony 5 project with Docker and Postgres
2227

23-
Watch full tutorial [here](https://youtu.be/69wjRPQ0A_U)
28+
There is a [video](https://youtu.be/69wjRPQ0A_U)
2429

2530
## How to use data transfer objects (DTO) in Symfony API application
2631

Diff for: composer.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,9 @@
2626
"symfony/property-info": "5.2.*",
2727
"symfony/proxy-manager-bridge": "5.2.*",
2828
"symfony/serializer": "5.2.*",
29+
"symfony/validator": "5.2.*",
2930
"symfony/yaml": "5.2.*"
3031
},
31-
"require-dev": {
32-
},
3332
"config": {
3433
"optimize-autoloader": true,
3534
"preferred-install": {

0 commit comments

Comments
 (0)