Hello,
I want to create a custom container from a dockerfile with apache2, php and sqlite3. But, when I mount the volumes for the config files apache2 or php (docker-compose), this file doesn’t appear. This config files exist in my container (when I disable the volume on docker-compose.yaml). I just want to have all files in the apache2 folder on my host to config it.
dockerfile :
FROM debian:bullseye-slim
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get -y update
RUN apt-get -y upgrade
RUN apt-get install -y jq bc curl sqlite3 libsqlite3-dev apache2 php7.4 php7.4-sqlite3
RUN /usr/bin/sqlite3 /etc/apache2/db/test.db
RUN mv /etc/cron.daily/* /home/
RUN apt-get clean autoclean
RUN apt-get autoremove --yes
RUN rm -rf /var/lib/apt/lists/*
RUN usermod -u 1008 www-data
CMD ["/usr/sbin/apache2ctl", "-DFOREGROUND"]
docker-compose
image_apache:
image: image_apache:latest
container_name: image_apache
build: /docker/image_apache
ports:
- "8183:80"
volumes:
- image_apache/www:/var/www
- image_apache/apache2:/etc/apache2
- image_apache/php:/etc/php
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
restart: always
Thank for your help !