Skip to content

Instantly share code, notes, and snippets.

@bellflower2015
Created July 4, 2019 13:13
Show Gist options
  • Save bellflower2015/913c8a0d77fa6a747e2fccebcd218dfe to your computer and use it in GitHub Desktop.
Save bellflower2015/913c8a0d77fa6a747e2fccebcd218dfe to your computer and use it in GitHub Desktop.
20190704: Apache2.4 + HTTPS(443) + mod_rewrite + PHP7.3 + MySQL5.5 + phpMyAdmin
version: '3'
services:
app:
build:
context: .
dockerfile: ./Dockerfile
hostname: docker.local
volumes:
- .:/var/www/html
ports:
- 80:80
- 443:443
links:
- mysql
depends_on:
- mysql
mysql:
image: mysql:5.5
ports:
- 3306:3306
volumes:
- ./mysql/mysql_init:/docker-entrypoint-initdb.d
- ./mysql/mysql_data:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: mysqluser
MYSQL_PASSWORD: mysqlpassword
phpmyadmin:
image: phpmyadmin/phpmyadmin
environment:
- PMA_ARBITRARY=1
- PMA_HOST=mysql
- PMA_USER=root
- PMA_PASSWORD=root
links:
- mysql
ports:
- 8080:80
volumes:
- ./phpmyadmin/sessions:/sessions
FROM php:7.3-apache
RUN docker-php-ext-install pdo_mysql
RUN apt-get update && apt-get install -y \
libssl-dev \
openssl \
ssl-cert \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& a2enmod ssl \
&& a2enmod rewrite \
&& a2ensite default-ssl
# mkcert -install
# mkcert docker.local
COPY docker.local-key.pem /etc/ssl/private/ssl-cert-snakeoil.key
COPY docker.local.pem /etc/ssl/certs/ssl-cert-snakeoil.pem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment