@@ -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://github.com/facebookincubator/create-react-app/b
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
0 commit comments