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.
Related
It seems that when i run Docker compose up, docker is not reading from docker-compose.yml.
It seems like it is loading images from cache or i don't think where is finding them.
Bellow is my docker-compose.yml
version: '3'
services:
httpd:
image: httpd:latest
user: root
ports:
- "80:80" # Default Apache port (Default on PHP 7.4)
- "8073:8073" # PHP 7.3 Apache port
- "8074:8074" # PHP 7.4 Apache port
- "8081:8081" # PHP 8.1 Apache port
volumes:
- ./:/var/www/html/myApp/:rw
- ./dev/Docker/httpd/httpd.conf:/usr/local/apache2/conf/httpd.conf
restart: on-failure
container_name: httpd
networks:
- mb-frontend
php8.1-fpm:
build: ./dev/Docker/php-fpm/8.1
user: root
environment:
XDEBUG_ENABLED: 1
XDEBUG_REMOTE_HOST: host.docker.internal
PHP_IDE_CONFIG: serverName=localhost
volumes:
- ./:/var/www/html/myApp/:rw
restart: on-failure
container_name: php8.1-fpm
networks:
- mb-frontend
- mb-backend
php7.4-fpm:
build: ./dev/Docker/php-fpm/7.4
user: root
environment:
XDEBUG_ENABLED: 1
XDEBUG_REMOTE_HOST: host.docker.internal
PHP_IDE_CONFIG: serverName=localhost
volumes:
- ./:/var/www/html/myApp/:rw
restart: on-failure
container_name: php7.4-fpm
networks:
- mb-frontend
- mb-backend
php7.3-fpm:
build: ./dev/Docker/php-fpm/7.3
user: root
environment:
XDEBUG_ENABLED: 1
XDEBUG_REMOTE_HOST: host.docker.internal
PHP_IDE_CONFIG: serverName=localhost
volumes:
- ./:/var/www/html/myApp/:rw
restart: on-failure
container_name: php7.3-fpm
networks:
- mb-frontend
- mb-backend
db:
image: mariadb:10.3.5
environment:
MYSQL_ROOT_PASSWORD: myPassword
MYSQL_USER: dev
MYSQL_PASSWORD: myPassword
ports:
- "3306:3306"
volumes:
- /root/Bureau/mysql:/var/lib/mysql/:rw
- ./dev/Docker/mariadb/conf.d/:/etc/mysql/conf.d/:rw
- ./dev/Docker/mariadb/config/init.sql:/docker-entrypoint-initdb.d/init.sql
restart: on-failure
container_name: db
networks:
- mb-backend
phpmyadmin:
image: phpmyadmin/phpmyadmin
environment:
PMA_HOST: db
volumes:
- /root/Bureau/phpmyadmin:/var/lib/mysql/
networks:
- mb-backend
depends_on:
- db
redis:
image: redis:6.2
container_name: redis
ports:
- "6379:6379"
networks:
- mb-backend
networks:
mb-frontend:
driver: bridge
mb-backend:
driver: bridge
I commented some images on docker-compose.yml but when i tape the command Docker compose up on terminal, all images even commented images are Up.
Can anyone help me how i force docker to read images from the edited docker-compose.yml
Good practice would be do use:
docker compose down
and then
docker compose up
UPDATE:
Next I would suggest to clean up your containers:
List all containers:
docker ps -a
Remove those you don't want because they might still be in the system
docker rm <CONTAINER ID/NAME>
How to Stop & Remove a running container by ID or Name?
The command is actually docker compose up.
The command docker-compose has been deprecated as of latest version. We can now use docker compose without the hyphen(-).
You can use docker-compose -f <path-to-compose-file> to pass in the compose file.
Example:
docker compose -f docker-compose.yml up
Reference documentation: https://docs.docker.com/compose/reference/
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?
I want to run php website with letsencrypt and nginx using docker-compose. But it doesn't work. I tried to use other simple web page (not php), like: index.html and it works.
My docker-compose file is based on this project: https://github.com/gilyes/docker-nginx-letsencrypt-sample/blob/master/docker-compose.yml.
Help me, please with php, thanks.
version: "2"
services:
nginx:
restart: always
image: nginx
container_name: nginx
ports:
- "80:80"
- "443:443"
volumes:
- "/etc/nginx/conf.d"
- "/etc/nginx/vhost.d"
- "./website:/usr/share/nginx/html"
- "./volumes/proxy/certs:/etc/nginx/certs:ro"
depends_on:
- fpm
nginx-gen:
restart: always
image: jwilder/docker-gen
container_name: nginx-gen
volumes:
- "/var/run/docker.sock:/tmp/docker.sock:ro"
- "./volumes/proxy/templates/nginx.tmpl:/etc/docker-gen/templates/nginx.tmpl:ro"
volumes_from:
- nginx
entrypoint: /usr/local/bin/docker-gen -notify-sighup nginx -watch -wait 5s:30s /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf
letsencrypt-nginx-proxy-companion:
restart: always
image: jrcs/letsencrypt-nginx-proxy-companion
container_name: letsencrypt-nginx-proxy-companion
volumes_from:
- nginx
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "./volumes/proxy/certs:/etc/nginx/certs:rw"
environment:
- NGINX_DOCKER_GEN_CONTAINER=nginx-gen
fpm:
restart: always
build: ./php-fpm
ports:
- "9000"
container_name: fpm-website
volumes:
- "./website:/usr/share/nginx/html" # folder with web-site
- "./php-fpm/php.ini-production.ini:/usr/local/etc/php/php.ini:ro"
environment:
- VIRTUAL_HOST=website.com
- LETSENCRYPT_HOST=website.com
- LETSENCRYPT_EMAIL=ser#website.com
Here is my Dockerfile for "fpm" container:
FROM php:7.3.2-fpm-alpine
RUN apk update; \
apk upgrade;
RUN docker-php-ext-install mysqli
When I try to open page, I have a message:
502 Bad Gateway
nginx/1.15.12
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 am a beginner with Docker. I followed a tutorial and add docker-compose.yml file.
The file looks like this -
version: '2'
services:
webserver:
build: ./docker/webserver
image: image_name
ports:
- "80:80"
- "443:443"
volumes:
- /Users/user_name/Sites/project_name:/var/www/html
links:
- db
db:
image: mysql:5.7
ports:
- "3306:3306"
volumes:
- ./db:/usr/local/mysql/bin/mysql
environment:
- MYSQL_ROOT_PASSWORD=
- MYSQL_DATABASE=DB_NAME
I am able to run the project on the web on localhost address but the connection to mysql is not ok.
When I run 'docker ps -a' on terminal ( I am using Mac)the Status of the mysql is - Exited (1) 16 seconds ago and the PORTS is empty.
Any idea/help?