admin管理员组文章数量:1122832
I have created the below docker compose file and used the official WordPress image to transfer my site from shared hosting to docker. Despite using the standard .htaccess file and adding exit; in index.php for testing purposes, the WordPress site remains inaccessible. I've also made the necessary changes in wp-config. I am unable to troubleshoot further, please help
version: '3.1'
services:
wordpress:
container_name: frix_wordpress
build:
context: .
dockerfile: Dockerfile
image: wordpress
restart: always
working_dir: /var/www/html
depends_on:
- db
ports:
- 8099:8082
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_USER: exampleuser
WORDPRESS_DB_PASSWORD: examplepass
WORDPRESS_DB_NAME: exampledb
volumes:
- .:/var/www/html
db:
container_name: frix_db
image: mysql:8.0
restart: always
environment:
MYSQL_DATABASE: exampledb
MYSQL_USER: exampleuser
MYSQL_PASSWORD: examplepass
MYSQL_RANDOM_ROOT_PASSWORD: '1'
volumes:
- db:/var/lib/mysql
volumes:
wordpress:
db:
I have created the below docker compose file and used the official WordPress image to transfer my site from shared hosting to docker. Despite using the standard .htaccess file and adding exit; in index.php for testing purposes, the WordPress site remains inaccessible. I've also made the necessary changes in wp-config. I am unable to troubleshoot further, please help
version: '3.1'
services:
wordpress:
container_name: frix_wordpress
build:
context: .
dockerfile: Dockerfile
image: wordpress
restart: always
working_dir: /var/www/html
depends_on:
- db
ports:
- 8099:8082
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_USER: exampleuser
WORDPRESS_DB_PASSWORD: examplepass
WORDPRESS_DB_NAME: exampledb
volumes:
- .:/var/www/html
db:
container_name: frix_db
image: mysql:8.0
restart: always
environment:
MYSQL_DATABASE: exampledb
MYSQL_USER: exampleuser
MYSQL_PASSWORD: examplepass
MYSQL_RANDOM_ROOT_PASSWORD: '1'
volumes:
- db:/var/lib/mysql
volumes:
wordpress:
db:
Share
Improve this question
asked Mar 27, 2024 at 7:29
csandreas1csandreas1
2063 silver badges11 bronze badges
1 Answer
Reset to default 1Seems that you are forwarding the wrong port. This way, the site should be accessible at http://localhost:8080
ports:
- 8080:80
本文标签: migrationMoving existing website to docker
版权声明:本文标题:migration - Moving existing website to docker 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736285271a1927425.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论