@@ -18,7 +18,7 @@ package manager) chart to deploy in a wink on any of these platforms.
18
18
19
19
1 . Build the PHP and NGINX Docker images:
20
20
21
- ```
21
+ ``` console
22
22
docker build -t gcr.io/test-api-platform/php -t gcr.io/test-api-platform/php:latest api --target api_platform_php
23
23
docker build -t gcr.io/test-api-platform/nginx -t gcr.io/test-api-platform/nginx:latest api --target api_platform_nginx
24
24
docker 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
28
28
29
29
Docker client versions <= 18.03:
30
30
31
- ```
31
+ ``` console
32
32
gcloud docker -- push gcr.io/test-api-platform/php
33
33
gcloud docker -- push gcr.io/test-api-platform/nginx
34
34
gcloud docker -- push gcr.io/test-api-platform/varnish
35
35
```
36
36
37
37
Docker client versions > 18.03:
38
38
39
- ```
39
+ ``` console
40
40
gcloud auth configure-docker
41
41
docker push gcr.io/test-api-platform/php
42
42
docker push gcr.io/test-api-platform/nginx
@@ -47,42 +47,42 @@ docker push gcr.io/test-api-platform/varnish
47
47
48
48
Firstly you need to update helm dependencies by running:
49
49
50
- ```
51
- helm dependency update ./api/helm/api
50
+ ``` console
51
+ helm dependency update ./api/helm/api
52
52
```
53
53
54
54
You are now ready to deploy the API!
55
55
56
56
Deploy your API to the container:
57
57
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$'
66
66
```
67
67
68
68
If you prefer to use a managed DBMS like [ Heroku Postgres] ( https://www.heroku.com/postgres ) or
69
69
[ Google Cloud SQL] ( https://cloud.google.com/sql/docs/postgres/ ) (recommended):
70
70
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
76
76
```
77
77
78
78
If you want to use a managed Varnish such as [ Fastly] ( https://www.fastly.com ) for the invalidation cache mechanism
79
79
provided by API Platform:
80
80
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
86
86
```
87
87
88
88
Finally, 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/).
92
92
93
93
Before running your application for the first time, be sure to create the database schema:
94
94
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
95
98
```
96
99
PHP_POD=$(kubectl --namespace=bar get pods -l app=php -o jsonpath="{.items[0].metadata.name}")
97
100
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
101
104
102
105
We noticed that some tiller RBAC trouble occurred. You can usually resolve it by running:
103
106
104
- ```
107
+ ```console
105
108
kubectl create serviceaccount --namespace kube-system tiller
106
109
serviceaccount "tiller" created
107
110
0 commit comments