Currently I encountered a problem when using local Sentry server. I'm using Lumen 5.4 and sentry-laravel package to write logs to Sentry server. But I got failed
Screenshot
Here is my docker-compose.yml:
version: '2'
services:
##
# Autodiscovery : Consul
##
autodiscovery:
build: ./autodiscovery/
mem_limit: 128m
expose:
- 53
- 8300
- 8301
- 8302
- 8400
- 8500
ports:
- 8500:8500
dns:
- 127.0.0.1
##
# Book Microservice
##
microservice_book_fpm:
build: ./microservices/book/php-fpm/
volumes_from:
- source_book
links:
- autodiscovery
- microservice_book_database
expose:
- 8080
environment:
- BACKEND=microservice-book-nginx
- CONSUL=autodiscovery
microservice_book_nginx:
build: ./microservices/book/nginx/
volumes_from:
- source_book
links:
- autodiscovery
- microservice_book_fpm
environment:
- BACKEND=microservice-book-fpm
- CONSUL=autodiscovery
ports:
- 8443:443
- 8081:80
- 9091:9090
microservice_book_database:
build: ./microservices/book/database/
environment:
- CONSUL=autodiscovery
- MYSQL_ROOT_PASSWORD=bookr_pwd
- MYSQL_DATABASE=bookr
- MYSQL_USER=bookr_usr
- MYSQL_PASSWORD=bookr_pwd
ports:
- 6666:3306
##
# Sentry
##
sentry_redis:
image: redis
expose:
- 6379
sentry_postgres:
image: postgres
environment:
- POSTGRES_PASSWORD=sentry
- POSTGRES_USER=sentry
volumes:
- /var/lib/postgresql/data
expose:
- 5432
sentry:
image: sentry
links:
- sentry_redis
- sentry_postgres
ports:
- 9876:9000
environment:
SENTRY_SECRET_KEY: 'b837e5a087c0a8727b1279bcdbe5a8a1'
SENTRY_POSTGRES_HOST: sentry_postgres
SENTRY_REDIS_HOST: sentry_redis
SENTRY_DB_USER: sentry
SENTRY_DB_PASSWORD: sentry
sentry_celery_beat:
image: sentry
links:
- sentry_redis
- sentry_postgres
command: sentry run cron
environment:
SENTRY_SECRET_KEY: 'b837e5a087c0a8727b1279bcdbe5a8a1'
SENTRY_POSTGRES_HOST: sentry_postgres
SENTRY_REDIS_HOST: sentry_redis
SENTRY_DB_USER: sentry
SENTRY_DB_PASSWORD: sentry
sentry_celery_worker:
image: sentry
links:
- sentry_redis
- sentry_postgres
command: sentry run worker
environment:
SENTRY_SECRET_KEY: 'b837e5a087c0a8727b1279bcdbe5a8a1'
SENTRY_POSTGRES_HOST: sentry_postgres
SENTRY_REDIS_HOST: sentry_redis
SENTRY_DB_USER: sentry
SENTRY_DB_PASSWORD: sentry
##
# Telemetry: prometheus
##
telemetry:
build: ./telemetry/
links:
- autodiscovery
expose:
- 9090
ports:
- 9090:9090
##
# Source containers
##
source_book:
image: nginx:stable
volumes:
- ../source/book:/var/www/html
command: "true"
Please help me figure out why I couldn't connect to local Sentry server from Docker container. Many thanks and sorry for my bad English :(
Related
Can someone please help.
I was running successfully my Symfony project via Docker containers. Suddenly when I access http://localhost/ I get the File not found. error?
I now that it means that system can not locate my files, but I am not sure what happened.
I see that my containers are built and running okay.
Also the same message I get when I try to test app endpoints through Postman.
I am on Mac Monterey 12.4.
Everything was working fine couple of hours ago. I just switched branches to change something, then switched back. The problem was on both branches..
Can someone help, I do not know what to do?
Docker config:
services:
db:
image: postgres:${POSTGRES_VERSION:-12}-alpine
environment:
POSTGRES_DB: ${POSTGRES_DB:-name}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-pass}
POSTGRES_USER: ${POSTGRES_USER:-postgres}
volumes:
- $PWD/postgres-data:/var/lib/postgresql/data:rw
profiles:
- db-in-docker
ports:
- "5432:5432"
networks:
- symfony
redis:
image: "redis:alpine"
command: redis-server /usr/local/etc/redis/redis.conf
ports:
- "6379:6379"
volumes:
- $PWD/redis-data:/var/lib/redis
- $PWD/redis/redis.conf:/usr/local/etc/redis/redis.conf
environment:
- REDIS_REPLICATION_MODE=master
networks:
- symfony
php:
container_name: "backend_php"
build:
context: ..
dockerfile: docker/php/Dockerfile
target: dev
args:
TIMEZONE: ${TIMEZONE}
volumes:
- symfony_docker_app_sync:/var/www/symfony/
depends_on:
- redis
networks:
- symfony
nginx:
build:
context: ./nginx
volumes:
- ../:/var/www/symfony/
ports:
- 80:80
depends_on:
- php
networks:
- symfony
env_file:
- .env.nginx.local
First of all: Why do you donĀ“t use the built in symfony server for local development? However - how looks your docker container configuration for your webserver?
Hello all Connections Greeting,
I am using this repository https://github.com/markshust/docker-magento for magento2 installation with docker.
I installed magento 2.3.3 and configured php 7.3 in docker file.
Problem is installation is completed without any error but, I am getting unable to connect after every new installation in browser.
Please help if you facing this same issue.
Thank you in advance.
docker-compose.yml file
# Mark Shust's Docker Configuration for Magento
# (https://github.com/markshust/docker-magento)
#
# Version 34.2.0
version: "3"
services:
app:
image: markoshust/magento-nginx:1.18-4
ports:
- "8000:80"
- "8443:443"
links:
- db
- phpfpm
volumes: &appvolumes
- ~/.composer:/var/www/.composer:cached
- appdata:/var/www/html
- sockdata:/sock
- ssldata:/etc/nginx/certs
phpfpm:
image: markoshust/magento-php:7.3-fpm-0
links:
- db
volumes: *appvolumes
db:
image: percona:5.7
command: --max_allowed_packet=64M
ports:
- "8080:3306"
env_file: env/db.env
volumes:
- dbdata:/var/lib/mysql
redis:
image: redis:5.0-alpine
elasticsearch:
image: markoshust/magento-elasticsearch:7.6.2-2
ports:
- "9200:9200"
- "9300:9300"
environment:
- "discovery.type=single-node"
myadmin:
image: phpmyadmin/phpmyadmin
container_name: phpmyadmin
restart: always
volumes:
- dbdata:/var/lib/mysql
ports:
- "8082:80"
depends_on:
- db
rabbitmq:
image: rabbitmq:3.7-management-alpine
ports:
- "15672:15672"
- "5672:5672"
volumes:
- rabbitmqdata:/var/lib/rabbitmq
# Disabling cron by default as it uses higher CPU, enable if needed
#cron:
# image: markoshust/magento-php:7.4-fpm-2
# user: root
# command: /usr/local/bin/cronstart
# tty: true
# links:
# - db
# volumes: *appvolumes
volumes:
appdata:
dbdata:
rabbitmqdata:
sockdata:
ssldata:
I am running below commands step by step
git clone https://github.com/markshust/docker-magento.git
cd docker-magento & curl -s https://raw.githubusercontent.com/markshust/docker-magento/master/lib/template | bash
bin download 2.3.3 & then add host in host file
bin/setup myhost.com
successfully installed magento database also created success fully but I can not access through browser.
I am runing a Symfony 3.4 application with docker, i need to upload a file and save it to /web/files. When i'm trying to do so i get an error:
Unable to create the "/home/docker/web/files/" directory
Note that i mounted the directory as Read-Write in cocker compose:
version: '2'
services:
front:
image: nginx
ports:
- "81:80"
links:
- "engine:engine"
- "db:db"
volumes:
- ".:/home/docker:ro"
- "./docker/front/default.conf:/etc/nginx/conf.d/default.conf:ro"
engine:
build: ./docker/engine/
volumes:
- ".:/home/docker:rw"
- "./docker/engine/php.ini:/usr/local/etc/php/conf.d/custom.ini:ro"
links:
- "db:db"
working_dir: "/home/docker"
db:
image: camptocamp/postgres:9.6
ports:
- "5433:5432"
environment:
- "POSTGRES_DB=pfe"
- "POSTGRES_PASSWORD=admin"
- "POSTGRES_USER=admin"
- "PGDATA=/var/lib/postgresql/data/pgdata"
I even created the directory files in /web, but its not working!
I create a separate container for my files, and just base it on an apache image. Then I use the volumes_from key to pass it into my php. Give something like this a try:
services:
apache:
build: ./build/httpd
links:
- php
ports:
- 80:80
- 443:443
volumes_from:
- app
php:
build: ./build/php
ports:
- 9000
- 9001
volumes_from:
- app
links:
- mariadb
- mail
app:
image: httpd:latest
volumes:
- ./:/var/www/html
command: "echo true"
I'm using docker to run my website.
I built php-fpm container for php using.
Phpinfo shows this info in the browser:
Additional .ini files parsed
/usr/local/etc/php/conf.d/docker-php-ext-gd.ini,
/usr/local/etc/php/conf.d/docker-php-ext-mcrypt.ini,
/usr/local/etc/php/conf.d/docker-php-ext-mongodb.ini,
/usr/local/etc/php/conf.d/docker-php-ext-mysqli.ini,
/usr/local/etc/php/conf.d/docker-php-ext-pdo_mysql.ini,
/usr/local/etc/php/conf.d/docker-php-ext-soap.ini,
/usr/local/etc/php/conf.d/docker-php-ext-zip.ini,
/usr/local/etc/php/conf.d/ext-xdebug.ini
But at the same time class_exists('MongoClient') returns false
My docker-compose.yml (that is not all services):
installer:
image: andreaskoch/dockerized-magento-installer
environment:
DOMAIN: dockerized-magento.local
volumes_from:
- nginx
volumes:
- ./config/installer/bin/install.sh:/bin/install.sh
links:
- "cache:rediscache"
- "sessions:redissession"
- "fullpagecache:redisfullpagecache"
- "solr:solr"
- "mysql:mysql"
- "mongodb:mongodb"
entrypoint: /bin/install.sh
nginx:
image: nginx:latest
ports:
- "80:80"
- "443:443"
links:
- "php"
volumes:
- ./logs/nginx:/var/log/nginx
volumes_from:
- php
php:
image: avestique/php7_fpm
links:
- "cache:rediscache"
- "sessions:redissession"
- "fullpagecache:redisfullpagecache"
- "solr:solr"
- "mysql:mysql"
- "mongodb:mongodb"
volumes:
- ./config/installer/php/php.ini:/usr/local/etc/php/php.ini
- ./config/installer/php/ext-xdebug.ini:/usr/local/etc/php/conf.d/ext-xdebug.ini
- ./htdocs:/var/www/htdocs
mongodb:
image: mongo:latest
environment:
- MONGO_DATA_DIR=/data/db
- MONGO_LOG_DIR=/dev/null
volumes:
- ./data/mongo:/data/db
ports:
- 27017:27017
command: mongod --smallfiles --logpath=/dev/null
Actually andreaskoch/dockerized-magento-installer has php5.6. But again - phpinfo shows PHP Version 7.0.28 and Server API FPM/FastCGI and it looks to
avestique/php7_fpm image.
Why MongoClient is not shown then?
I am quite new to docker and have been battling two days to get my system going. My compose file creates nginx, php-fpm, mysql and phpmyadmin containers. I can ping all containers from each other. But when I try installing anything from my mounted public_html volume into the database (like installing an app that needs to create tables in database), the app simply cannot connect to the database. I have made sure over and over credentials are correct. For the life of me I don't know where I'm going wrong. Any help would be greatly appreciated. I include my compose file below:
version: '3'
services:
www:
container_name: site1-www
image: nginx:1.13.7-alpine
expose:
- "80"
ports:
- 8001:80
networks:
datacentre:
aliases:
- site1www
env_file:
- ".env"
environment:
- NGINX_HOST=localhost
volumes:
- /mnt/www/site1.test/public_html:/usr/share/nginx/html/
-
/mnt/www/site1.test/conf/default.conf:/etc/nginx/conf.d/default.conf
depends_on:
- db
links
- db
phpfpm:
build: ./phpfpm
container_name: site1-phpfpm
networks:
datacentre:
aliases:
- site1php
volumes:
- /mnt/www/site1.test/public_html:/usr/share/nginx/html
- /mnt/www/site1.test/conf/php.ini:/usr/local/etc/php/php.ini
depends_on:
- db
links
- db
db:
container_name: site1-db
image: mariadb:10.3.2
ports:
- 3400:3306
env_file:
- ".env"
environment:
- MYSQL_DATABASE=test1db
- MYSQL_ROOT_PASSWORD=password
- MYSQL_USER=test1user
- MYSQL_PASSWORD=password
networks:
datacentre:
aliases:
- site1db
volumes:
- /mnt/dbdata:/var/lib/mysql
dbadmin:
image: phpmyadmin/phpmyadmin:latest
container_name: site1-dbadmin
ports:
- 8000:80
networks:
datacentre:
aliases:
- site1dbadmin
environment:
- PMA_ARBITRARY=1
- PMA_HOST=mysql
depends_on:
- db
links
- db
networks:
datacentre:
external:
name: datacentre_net
The compose setup looks a bit complex for a first shot. Remove all the names and aliases and use service names for connections. Then build from there.
For the www service, nginx should configure phpfpm:9000 as the FastCGI worker.
Your PHP application and phpMyAdmin should be configured to connect to db:3306
version: '3'
services:
www:
image: nginx:1.13.7-alpine
ports:
- 8001:80
env_file:
- ".env"
environment:
- NGINX_HOST=localhost
volumes:
- /mnt/www/site1.test/public_html:/usr/share/nginx/html/
- /mnt/www/site1.test/conf/default.conf:/etc/nginx/conf.d/default.conf
depends_on:
- phpfpm
phpfpm:
build: ./phpfpm
volumes:
- /mnt/www/site1.test/public_html:/usr/share/nginx/html
- /mnt/www/site1.test/conf/php.ini:/usr/local/etc/php/php.ini
depends_on:
- db
db:
image: mariadb:10.3.2
ports:
- 3400:3306
env_file:
- ".env"
environment:
- MYSQL_DATABASE=test1db
- MYSQL_ROOT_PASSWORD=password
- MYSQL_USER=test1user
- MYSQL_PASSWORD=password
volumes:
- /mnt/dbdata:/var/lib/mysql
dbadmin:
image: phpmyadmin/phpmyadmin:latest
ports:
- 8000:80
environment:
- PMA_ARBITRARY=1
- PMA_HOST=db
depends_on:
- db
links are not required to access services on a user defined network.