Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

123
Views
Is there a way to add custom apache site.conf with docker-compose and active it?

I want use docker as backend after some years with LAMP, I'm using docker with docker-compose.

Here docker-compose.yml:

services:
    php:
        image: php:8.0-apache
        container_name: php
        restart: always
        ports:
            - "80:80"
        volumes:
            - /var/www/docker/php:/var/www/html
            - ./conf:/etc/apache2/sites-available
        links:
            - db:db
    db:
        image: mysql
        container_name: db
        restart: always
        volumes:
            - ~/mysql:/var/lib/mysql
        ports:
            - "3306:3306"
        environment:
            - MYSQL_ROOT_PASSWORD=root
    admin:
        image: phpmyadmin/phpmyadmin
        container_name: admin
        ports:
            - "8080:80"
        links:
            - db:db

So I erase /etc/apache2/sites-available who already contain 000-default.conf with my local.dev.conf:

<VirtualHost *:80>
    DocumentRoot /var/www/html/
    ServerName local.dev
    <Directory /var/www/html/>
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

I put a basic index.php file in /var/www/html in container that displays 'test' but it only displays at http://localhost and I want it at http://local.dev

I saw there is a file docker-php.conf but how to change it cause erase 000-default.conf seems change nothing?

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!