@@ -18,7 +18,7 @@ package manager) chart to deploy in a wink on any of these platforms.
1818
19191 . Build the PHP and NGINX Docker images:
2020
21- ```
21+ ``` console
2222docker build -t gcr.io/test-api-platform/php -t gcr.io/test-api-platform/php:latest api --target api_platform_php
2323docker build -t gcr.io/test-api-platform/nginx -t gcr.io/test-api-platform/nginx:latest api --target api_platform_nginx
2424docker build -t gcr.io/test-api-platform/varnish -t gcr.io/test-api-platform/varnish:latest api --target api_platform_varnish
@@ -28,15 +28,15 @@ docker build -t gcr.io/test-api-platform/varnish -t gcr.io/test-api-platform/var
2828
2929Docker client versions <= 18.03:
3030
31- ```
31+ ``` console
3232gcloud docker -- push gcr.io/test-api-platform/php
3333gcloud docker -- push gcr.io/test-api-platform/nginx
3434gcloud docker -- push gcr.io/test-api-platform/varnish
3535```
3636
3737Docker client versions > 18.03:
3838
39- ```
39+ ``` console
4040gcloud auth configure-docker
4141docker push gcr.io/test-api-platform/php
4242docker push gcr.io/test-api-platform/nginx
@@ -47,42 +47,42 @@ docker push gcr.io/test-api-platform/varnish
4747
4848Firstly you need to update helm dependencies by running:
4949
50- ```
51- helm dependency update ./api/helm/api
50+ ``` console
51+ helm dependency update ./api/helm/api
5252```
5353
5454You are now ready to deploy the API!
5555
5656Deploy your API to the container:
5757
58- ```
59- helm install ./api/helm/api --namespace=baz --name baz \
60- --set php.repository=gcr.io/test-api-platform/php \
61- --set nginx.repository=gcr.io/test-api-platform/nginx \
62- --set secret=MyAppSecretKey \
63- --set postgresql.postgresPassword=MyPgPassword \
64- --set postgresql.persistence.enabled=true \
65- --set corsAllowOrigin='^https?://[a-z\]*\.mywebsite.com$'
58+ ``` console
59+ helm install ./api/helm/api --namespace=baz --name baz \
60+ --set php.repository=gcr.io/test-api-platform/php \
61+ --set nginx.repository=gcr.io/test-api-platform/nginx \
62+ --set secret=MyAppSecretKey \
63+ --set postgresql.postgresPassword=MyPgPassword \
64+ --set postgresql.persistence.enabled=true \
65+ --set corsAllowOrigin='^https?://[a-z\]*\.mywebsite.com$'
6666```
6767
6868If you prefer to use a managed DBMS like [ Heroku Postgres] ( https://www.heroku.com/postgres ) or
6969[ Google Cloud SQL] ( https://cloud.google.com/sql/docs/postgres/ ) (recommended):
7070
71- ```
72- helm install --name api ./api/helm/api \
73- # ...
74- --set postgresql.enabled=false \
75- --set postgresql.url=pgsql://username:password@host/database?serverVersion=9.6
71+ ``` console
72+ helm install --name api ./api/helm/api \
73+ # ...
74+ --set postgresql.enabled=false \
75+ --set postgresql.url=pgsql://username:password@host/database?serverVersion=9.6
7676```
7777
7878If you want to use a managed Varnish such as [ Fastly] ( https://www.fastly.com ) for the invalidation cache mechanism
7979provided by API Platform:
8080
81- ```
82- helm install --name api ./api/helm/api \
83- # ...
84- --set varnish.enabled=false \
85- --set varnish.url=https://myvarnish.com
81+ ``` console
82+ helm install --name api ./api/helm/api \
83+ # ...
84+ --set varnish.enabled=false \
85+ --set varnish.url=https://myvarnish.com
8686```
8787
8888Finally, build the ` client ` and ` admin ` JavaScript apps and [ deploy them on a static
@@ -92,6 +92,9 @@ website hosting service](https://create-react-app.dev/docs/deployment/).
9292
9393Before running your application for the first time, be sure to create the database schema:
9494
95+ ``` console
96+ PHP_POD=$(kubectl --namespace=bar get pods -l app=php -o jsonpath="{.items[0].metadata.name}")
97+ kubectl --namespace=bar exec -it $PHP_POD -- bin/console doctrine:schema:create
9598```
9699 PHP_POD=$(kubectl --namespace=bar get pods -l app=php -o jsonpath="{.items[0].metadata.name}")
97100 kubectl --namespace=bar exec -it $PHP_POD -- bin/console doctrine:schema:create
@@ -101,7 +104,7 @@ Before running your application for the first time, be sure to create the databa
101104
102105We noticed that some tiller RBAC trouble occurred. You can usually resolve it by running:
103106
104- ```
107+ ```console
105108kubectl create serviceaccount --namespace kube-system tiller
106109 serviceaccount "tiller" created
107110
0 commit comments