Skip to content

Commit c528b3d

Browse files
committed
feat: allow to install the website skeleton
1 parent a0192fd commit c528b3d

File tree

5 files changed

+29
-11
lines changed

5 files changed

+29
-11
lines changed

Dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,17 @@ ENV PATH="${PATH}:/root/.composer/vendor/bin"
8282

8383
WORKDIR /srv/app
8484

85+
# Allow to choose skeleton
86+
ARG SKELETON="symfony/skeleton"
87+
ENV SKELETON ${SKELETON}
88+
8589
# Allow to use development versions of Symfony
8690
ARG STABILITY="stable"
87-
ENV STABILITY ${STABILITY:-stable}
91+
ENV STABILITY ${STABILITY}
8892

8993
# Allow to select skeleton version
9094
ARG SYMFONY_VERSION=""
95+
ENV SYMFONY_VERSION ${SYMFONY_VERSION}
9196

9297
# Download the Symfony skeleton and leverage Docker cache layers
9398
RUN composer create-project "symfony/skeleton ${SYMFONY_VERSION}" . --stability=$STABILITY --prefer-dist --no-dev --no-progress --no-interaction; \

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ services:
77
target: symfony_php
88
args:
99
SYMFONY_VERSION: ${SYMFONY_VERSION:-}
10+
SKELETON: ${SKELETON:-symfony/skeleton}
1011
STABILITY: ${STABILITY:-stable}
1112
restart: unless-stopped
1213
volumes:
@@ -23,7 +24,6 @@ services:
2324
MERCURE_URL: ${CADDY_MERCURE_URL:-http://caddy/.well-known/mercure}
2425
MERCURE_PUBLIC_URL: https://${SERVER_NAME:-localhost}/.well-known/mercure
2526
MERCURE_JWT_SECRET: ${CADDY_MERCURE_JWT_SECRET:-!ChangeMe!}
26-
SYMFONY_VERSION:
2727

2828
caddy:
2929
build:

docker/php/docker-entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ if [ "$1" = 'php-fpm' ] || [ "$1" = 'php' ] || [ "$1" = 'bin/console' ]; then
1717

1818
# The first time volumes are mounted, the project needs to be recreated
1919
if [ ! -f composer.json ]; then
20-
composer create-project "symfony/skeleton $SYMFONY_VERSION" tmp --stability=$STABILITY --prefer-dist --no-progress --no-interaction
20+
composer create-project "$SKELETON $SYMFONY_VERSION" tmp --stability="$STABILITY" --prefer-dist --no-progress --no-interaction
2121
jq '.extra.symfony.docker=true' tmp/composer.json >tmp/composer.tmp.json
2222
rm tmp/composer.json
2323
mv tmp/composer.tmp.json tmp/composer.json

docs/build.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,33 @@
11
# Build Options
22

3+
## Selection a Symfony Skeleton
4+
5+
By default, Symfony Docker will install the minimalist skeleton.
6+
To install the ["website skeleton"](https://symfony.com/doc/current/setup.html#creating-symfony-applications), use the following command:
7+
8+
SKELETON=symfony/website-skeleton docker-compose up --build
9+
310
## Selecting a Specific Symfony Version
411

512
Use the `SYMFONY_VERSION` environment variable to select a specific Symfony version.
613

714
For instance, use the following command to install Symfony 4.4:
815

9-
$ SYMFONY_VERSION=4.4.* docker-compose up --build
16+
SYMFONY_VERSION=4.4.* docker-compose up --build
17+
18+
## Installing Development Versions of Symfony
1019

1120
To install a non-stable version of Symfony, use the `STABILITY` environment variable during the build.
1221
The value must be [a valid Composer stability option](https://getcomposer.org/doc/04-schema.md#minimum-stability)) .
1322

1423
For instance, use the following command to use the `master` branch of Symfony:
1524

16-
$ STABILITY=dev docker-compose up --build
25+
STABILITY=dev docker-compose up --build
1726

1827
## Customizing the Server Name
1928

2029
Use the `SERVER_NAME` environment variable to define your custom server name(s).
2130

22-
$ SERVER_NAME="symfony.wip, caddy:80" docker-compose up --build
31+
SERVER_NAME="symfony.wip, caddy:80" docker-compose up --build
2332

2433
If you use Mercure, keep `caddy:80` in the list to allow the PHP container to request the caddy service.

docs/xdebug.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,17 @@ services:
5151
5252
Then run:
5353
54-
$ docker-compose -f docker-compose.yml -f docker-compose.debug.yml up -d
54+
```console
55+
docker-compose -f docker-compose.yml -f docker-compose.debug.yml up -d
56+
```
5557

5658
## Troubleshooting
5759

5860
Inspect the installation with the following command. The requested Xdebug version should be displayed in the output.
5961

60-
$ docker-compose exec php php --version
61-
62-
PHP ...
63-
with Xdebug v3.0.4 ...
62+
```console
63+
$ docker-compose exec php php --version
64+
65+
PHP ...
66+
with Xdebug v3.0.4 ...
67+
```

0 commit comments

Comments
 (0)