Skip to content
This repository was archived by the owner on Nov 4, 2021. It is now read-only.

Commit d6545c5

Browse files
committed
Moved driver initialization to php container
1 parent 1a99181 commit d6545c5

File tree

5 files changed

+46
-42
lines changed

5 files changed

+46
-42
lines changed

docker/docker-compose.yml

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ services:
2222
version: v5.6.*
2323
dockerfile: Dockerfile
2424
volumes:
25-
- ./..:/app/driver
2625
- laravel:/app/laravel
2726
networks:
2827
- default-net
@@ -35,7 +34,7 @@ services:
3534
depends_on:
3635
- laravel
3736
- mysql
38-
# - elastic
37+
- elastic
3938
volumes:
4039
- ./..:/app/driver
4140
- laravel:/app/laravel
@@ -56,29 +55,29 @@ services:
5655
- default-net
5756
ports:
5857
- 13306:3306
59-
# elastic:
60-
# build:
61-
# context: elastic
62-
# args:
63-
# version: 6.2.4
64-
# dockerfile: Dockerfile
65-
# volumes:
66-
# - ./elastic/data:/usr/share/elasticsearch/data
67-
# networks:
68-
# - default-net
69-
# ports:
70-
# - 19200:9200
71-
# kibana:
72-
# build:
73-
# context: kibana
74-
# args:
75-
# version: 6.2.4
76-
# dockerfile: Dockerfile
77-
# depends_on:
78-
# - elastic
79-
# environment:
80-
# ELASTICSEARCH_URL: http://elastic:9200
81-
# networks:
82-
# - default-net
83-
# ports:
84-
# - 15601:5601
58+
elastic:
59+
build:
60+
context: elastic
61+
args:
62+
version: 6.2.4
63+
dockerfile: Dockerfile
64+
volumes:
65+
- ./elastic/data:/usr/share/elasticsearch/data
66+
networks:
67+
- default-net
68+
ports:
69+
- 19200:9200
70+
kibana:
71+
build:
72+
context: kibana
73+
args:
74+
version: 6.2.4
75+
dockerfile: Dockerfile
76+
depends_on:
77+
- elastic
78+
environment:
79+
ELASTICSEARCH_URL: http://elastic:9200
80+
networks:
81+
- default-net
82+
ports:
83+
- 15601:5601

docker/laravel/Dockerfile

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,3 @@ COPY database/seeds/* database/seeds/
2020

2121
# Regenerate autoloader
2222
RUN composer dump-autoload --no-interaction
23-
24-
# Bootstrap
25-
COPY bootstrap /usr/local/bin/bootstrap
26-
RUN chmod 544 /usr/local/bin/bootstrap
27-
CMD ["bootstrap"]

docker/laravel/bootstrap

Lines changed: 0 additions & 8 deletions
This file was deleted.

docker/php/Dockerfile

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,21 @@ ARG version
22

33
FROM php:${version}-cli
44

5-
# Install necessary php extensions
5+
# Install system libraries
6+
RUN apt-get update -y && apt-get install -y \
7+
unzip \
8+
zlib1g-dev \
9+
git
10+
11+
# Install php extensions
612
RUN docker-php-ext-install \
13+
zip \
714
pdo_mysql
815

16+
# Install composer
17+
RUN curl -sS https://getcomposer.org/installer | \
18+
php -- --install-dir=/usr/bin/ --filename=composer
19+
920
WORKDIR /app/laravel
1021

1122
# Bootstrap

docker/php/bootstrap

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
#!/bin/sh
22

3+
# Add driver repository
4+
composer config --no-interaction repositories.scout-elasticsearch-driver \
5+
'{"type": "path", "url": "../driver", "options": {"symlink": true}}'
6+
7+
# Require driver package
8+
composer require --no-interaction --prefer-dist babenkoivan/scout-elasticsearch-driver:@dev
9+
310
# Clear application cache
411
php artisan cache:clear --no-interaction
512

0 commit comments

Comments
 (0)