Skip to content

Commit d709b24

Browse files
add prod settings and chart
1 parent 23ed8f3 commit d709b24

18 files changed

+763
-14
lines changed

.dockerignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.git
2+
vendor
3+
node_modules
4+
tests
5+
var

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,6 @@ node_modules
4343

4444
# System files
4545
.DS_Store
46+
47+
deploy/secrets.yaml
48+
deploy/charts

Dockerfile

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# install php dependencies in intermediate container
2+
FROM composer:latest AS composer
3+
4+
WORKDIR /var/www/html
5+
6+
RUN composer global require hirak/prestissimo --no-plugins --no-scripts
7+
8+
COPY composer.* /var/www/html/
9+
RUN composer install --apcu-autoloader -o --no-dev --no-scripts --ignore-platform-reqs
10+
11+
# build actual application image
12+
FROM php:7.4-apache
13+
14+
WORKDIR /var/www/html
15+
16+
# install packages
17+
# inkscape is recommended for handling svg files with imagemagick
18+
RUN apt-get update && apt-get install -y \
19+
libicu-dev \
20+
libpng-dev \
21+
libmagickwand-dev \
22+
inkscape
23+
24+
# install PHP extensions
25+
RUN docker-php-ext-configure intl && docker-php-ext-install -j$(nproc) \
26+
intl \
27+
pdo \
28+
pdo_mysql
29+
30+
RUN pecl install redis apcu imagick && docker-php-ext-enable redis apcu imagick
31+
32+
# apache config
33+
RUN /usr/sbin/a2enmod rewrite && /usr/sbin/a2enmod headers && /usr/sbin/a2enmod expires
34+
35+
# copy needed files from build containers
36+
COPY --from=composer /var/www/html/vendor/ /var/www/html/vendor/
37+
38+
COPY . /var/www/html/
39+
40+
# php config
41+
ADD ./deploy/config/php.ini /usr/local/etc/php/conf.d/custom.ini
42+
43+
# apache config
44+
COPY ./deploy/config/apache.conf /etc/apache2/sites-available/000-default.conf

README.md

+44
Original file line numberDiff line numberDiff line change
@@ -1 +1,45 @@
11
# Sulu Kubernetes example Deployment
2+
3+
1. Build your container
4+
5+
```
6+
docker build . -t eu.gcr.io/sulu-io/sulu-cluster:1.0.0
7+
docker push eu.gcr.io/sulu-io/sulu-cluster:1.0.0
8+
```
9+
10+
2. Create Cluster
11+
12+
```
13+
gcloud beta container --project "sulu-io" clusters create "my-first-cluster-1" --zone "europe-west3-c" --no-enable-basic-auth --cluster-version "1.15.12-gke.2" --release-channel "stable" --machine-type "g1-small" --image-type "COS" --disk-type "pd-standard" --disk-size "32" --metadata disable-legacy-endpoints=true --scopes "https://www.googleapis.com/auth/devstorage.read_only","https://www.googleapis.com/auth/logging.write","https://www.googleapis.com/auth/monitoring","https://www.googleapis.com/auth/servicecontrol","https://www.googleapis.com/auth/service.management.readonly","https://www.googleapis.com/auth/trace.append" --num-nodes "3" --no-enable-stackdriver-kubernetes --enable-ip-alias --network "projects/sulu-io/global/networks/default" --subnetwork "projects/sulu-io/regions/europe-west3/subnetworks/default" --default-max-pods-per-node "110" --no-enable-master-authorized-networks --addons HorizontalPodAutoscaling,HttpLoadBalancing --enable-autoupgrade --enable-autorepair --max-surge-upgrade 1 --max-unavailable-upgrade 0
14+
```
15+
16+
3. Connect to cluster
17+
18+
```
19+
gcloud container clusters get-credentials my-first-cluster-1 --zone europe-west3-c --project sulu-io
20+
```
21+
22+
4. Create service account
23+
24+
Download the key and add cloud-storage admin permissions to the service account in a bucket.
25+
26+
5. Configure secret values
27+
28+
Copy the `deploy/secrets.dist.yaml` to `deploy/secrets.yaml`.
29+
30+
Configure the redis password and the google cloud credentials in the secrets file.
31+
32+
6. Install App
33+
34+
```
35+
cd deploy
36+
helm3 dep build
37+
helm3 install sulu-cluster . -f secrets.yaml
38+
```
39+
40+
7. Upgrade App
41+
42+
```
43+
cd deploy
44+
helm3 upgrade sulu-cluster . -f secrets.yaml
45+
```

composer.json

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"handcraftedinthealps/zendsearch": "^2.0",
3535
"jackalope/jackalope-doctrine-dbal": "^1.3",
3636
"sulu/sulu": "~2.1.1",
37+
"superbalist/flysystem-google-storage": "^7.2",
3738
"symfony/config": "^5.1",
3839
"symfony/dotenv": "^5.1",
3940
"symfony/flex": "^1.2",

0 commit comments

Comments
 (0)