Skip to content
Permalink
Browse files

Upgrade repository to use latest versions

  • Loading branch information
eko committed Nov 30, 2019
1 parent 34dba2b commit 06e5274276c5d38cefef570b634fa08576308379
@@ -1,7 +1,7 @@
sudo: required

env:
DOCKER_COMPOSE_VERSION: 1.16.1
DOCKER_COMPOSE_VERSION: 1.25.0

services:
- docker
@@ -15,5 +15,5 @@ before_install:
- mkdir symfony

script:
- docker-compose -f docker-compose.travis.yml up -d
- docker-compose -f docker-compose.travis.yml ps
- docker-compose -f docker-compose.yml up -d
- docker-compose -f docker-compose.yml ps
@@ -39,18 +39,22 @@ Here are the `docker-compose` built images:
* `db`: This is the MySQL database container (can be changed to postgresql or whatever in `docker-compose.yml` file),
* `php`: This is the PHP-FPM container including the application volume mounted on,
* `nginx`: This is the Nginx webserver container in which php volumes are mounted too,
* `elk`: This is a ELK stack container which uses Logstash to collect logs, send them into Elasticsearch and visualize them with Kibana.
* `elasticsearch`: This is the Elasticsearch server used to store our web server and application logs,
* `logstash`: This is the Logstash tool from Elastic Stack that allows to read logs and send them into our Elasticsearch server,
* `kibana`: This is the Kibana UI that is used to render logs and create beautiful dashboards.

This results in the following running containers:

```bash
> $ docker-compose ps
Name Command State Ports
--------------------------------------------------------------------------------------------
dockersymfony_db_1 docker-entrypoint.sh mysqld Up 0.0.0.0:3306->3306/tcp
dockersymfony_elk_1 /usr/bin/supervisord -n -c ... Up 0.0.0.0:81->80/tcp
dockersymfony_nginx_1 nginx Up 443/tcp, 0.0.0.0:80->80/tcp
dockersymfony_php_1 php-fpm7 -F Up 0.0.0.0:9000->9000/tcp
Name Command State Ports
-----------------------------------------------------------------------------------------------------------
docker-symfony_db_1 docker-entrypoint.sh --def ... Up 0.0.0.0:3306->3306/tcp, 33060/tcp
docker-symfony_elasticsearch_1 /usr/local/bin/docker-entr ... Up 0.0.0.0:9200->9200/tcp, 9300/tcp
docker-symfony_kibana_1 /usr/local/bin/dumb-init - ... Up 0.0.0.0:81->5601/tcp
docker-symfony_logstash_1 /usr/local/bin/docker-entr ... Up 5044/tcp, 9600/tcp
docker-symfony_nginx_1 nginx Up 443/tcp, 0.0.0.0:80->80/tcp
docker-symfony_php_1 php-fpm7 -F Up 0.0.0.0:9000->9001/tcp
```

# Read logs

This file was deleted.

@@ -28,13 +28,25 @@ services:
volumes:
- ./logs/nginx:/var/log/nginx:cached
- ./symfony:/var/www/symfony:cached
elk:
image: willdurand/elk
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.4.2
environment:
discovery.type: "single-node"
ports:
- "81:80"
- "9200:9200"
logstash:
image: docker.elastic.co/logstash/logstash:7.4.2
volumes:
- ./elk/logstash:/etc/logstash:cached
- ./elk/logstash/patterns:/opt/logstash/patterns:cached
- ./elk/logstash/pipelines.yml:/usr/share/logstash/config/pipelines.yml:cached
- ./elk/logstash/conf.d:/etc/logstash/conf.d:cached
- ./logs/symfony:/var/www/symfony/var/log:cached
- ./logs/nginx:/var/log/nginx:cached

kibana:
image: docker.elastic.co/kibana/kibana:7.4.2
environment:
SERVER_NAME: localhost
ELASTICSEARCH_HOSTS: http://elasticsearch:9200
links:
- elasticsearch
ports:
- "81:5601"
@@ -19,21 +19,20 @@ input {
filter {
if [type] == "nginx_access" {
grok {
patterns_dir => "./patterns"
patterns_dir => ["/etc/logstash/conf.d/patterns"]
match => { "message" => "%{NGINXACCESS}"}
}
}
else if [type] in ["symfony_dev", "symfony_prod"] {
grok {
patterns_dir => "./patterns"
patterns_dir => ["/etc/logstash/conf.d/patterns"]
match => { "message" => "%{SYMFONY}"}
}
}
}

output {
elasticsearch {
host => "localhost"
cluster => "logstash"
hosts => "elasticsearch:9200"
}
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,2 @@
- pipeline.id: application
path.config: "/etc/logstash/conf.d/application.conf"
@@ -1,6 +1,6 @@
FROM alpine:3.8
FROM alpine:3.10

MAINTAINER Vincent Composieux <vincent.composieux@gmail.com>
LABEL maintainer="Vincent Composieux <vincent.composieux@gmail.com>"

RUN apk add --update --no-cache nginx

@@ -1,4 +1,4 @@
FROM alpine:3.8
FROM alpine:3.10

LABEL maintainer="Vincent Composieux <vincent.composieux@gmail.com>"

0 comments on commit 06e5274

Please sign in to comment.
You can’t perform that action at this time.