最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

php - Why is my docker not working. 403 forbidden - Stack Overflow

programmeradmin6浏览0评论

I'm very new to docker and for the past week i have been trying to fix some issues. I decided to wipe it all clean and restart following a few tutorials. A lot of things worked before, except i had some database issues. The problem is that half thing i do from the tutorial, i simply don't understand so i am not really sure where i could have gone wrong. And now docker can't find my index is my assumption.. but i don't know how to fix it and all the resources online are so overwhelming and complicated to me.

Also i am on Ubuntu and my index.php is inside a src directory which is in the project root directory.

My docker-compose.yml:

services:
  apache-php:
    image: apache-pdo
    build:
      context: .
      dockerfile: Dockerfile
    volumes:
      - /home/marnix/Documents/hacklab_php/book_management_system/var/www/html
    ports:
      - "80:80"
    networks:
      - app-network
  mysql:
    image: mysql
    volumes:
      - /home/marnix/Documents/hacklab_php/DB:/var/lib/mysql
    environment:
      MYSQL_ROOT_PASSWORD: password
    networks:
      - app-network
  phpmyadmin:
    image: phpmyadmin
    environment:
      PMA_HOST: mysql
    ports:
      - "8080:80"
    depends_on:
      - mysql
    networks:
      - app-network
networks:
  app-network:
    driver: bridge

my Dockerfile:

RUN docker-php-ext-install pdo pdo_mysql
EXPOSE 80

RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf
RUN sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf

LABEL .opencontainers.image.source="; \
    repository="; \
    maintainer="MilesChou <[email protected]>"

RUN pecl install xdebug \
    && docker-php-ext-enable xdebug
发布评论

评论列表(0)

  1. 暂无评论