Hi There,
I’m trying to figure out why this docker-compose en local Dockerfile are not mounting correctly into ‘./wordpress’. I tried it using image:wordpress and that does work, so that suggest there is something wrong with my Dockerfile, but i canit figure out what.
This is what i use now:
version: '3'
services:
db:
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: enviu_dev
MYSQL_DATABASE: enviu_dev
networks:
new:
aliases:
- db
legacy:
aliases:
- mysql
wp:
build:
context: .
dockerfile: Dockerfile
volumes:
- ./wordpress:/var/www/html
ports:
- "8080:80"
networks:
- legacy
phpmyadmin:
image: phpmyadmin/phpmyadmin
networks:
- new
ports:
- 8181:80
environment:
PMA_USER: root
PMA_PASSWORD: enviu_dev
volumes:
db_data:
networks:
new:
legacy:
# See https://github.com/docker-library/wordpress/tree/618490d4bdff6c5774b84b717979bfe3d6ba8ad1
FROM php:5.6-apache
RUN a2enmod rewrite
COPY /apache/php.ini /usr/local/etc/php/
# install the PHP extensions we need
RUN apt-get update && apt-get install -y libpng12-dev libjpeg-dev zip && rm -rf /var/lib/apt/lists/* \
&& docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \
&& docker-php-ext-install gd
RUN docker-php-ext-install mysqli
RUN apt-get update \
&& apt-get install -y zlib1g-dev \
&& rm -rf /var/lib/apt/lists/* \
&& docker-php-ext-install zip
ENV WORDPRESS_VERSION 4.2.1
ENV WORDPRESS_UPSTREAM_VERSION 4.2.1
ENV WORDPRESS_SHA1 c93a39be9911591b19a94743014be3585df0512f
# upstream tarballs include ./wordpress/ so this gives us /usr/src/wordpress
RUN curl -o wordpress.tar.gz -SL https://wordpress.org/wordpress-${WORDPRESS_UPSTREAM_VERSION}.tar.gz \
&& echo "$WORDPRESS_SHA1 *wordpress.tar.gz" | sha1sum -c - \
&& tar -xzf wordpress.tar.gz -C /usr/src/ \
&& rm wordpress.tar.gz \
&& chown -R www-data:www-data /usr/src/wordpress
I’m using the local Dockerfile to install the zip extension (and probably more later on) and get a
Anyways, any help would be appreciated. It might be a small thing, but i can’t seem to make it working.