Skip to content

Commit 3641992

Browse files
committed
first push
0 parents  commit 3641992

File tree

7 files changed

+91
-0
lines changed

7 files changed

+91
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.DS_Store

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Web development docker environment
2+
3+
TODO...

apache/Dockerfile

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM httpd:2.4.33-alpine
2+
RUN apk update; \
3+
apk upgrade;
4+
# Copy apache vhost file to proxy php requests to php-fpm container
5+
COPY demo.apache.conf /usr/local/apache2/conf/demo.apache.conf
6+
RUN echo "Include /usr/local/apache2/conf/demo.apache.conf" \
7+
>> /usr/local/apache2/conf/httpd.conf

apache/demo.apache.conf

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
ServerName localhost
2+
3+
LoadModule deflate_module /usr/local/apache2/modules/mod_deflate.so
4+
LoadModule proxy_module /usr/local/apache2/modules/mod_proxy.so
5+
LoadModule proxy_fcgi_module /usr/local/apache2/modules/mod_proxy_fcgi.so
6+
7+
<VirtualHost *:80>
8+
# Proxy .php requests to port 9000 of the php-fpm container
9+
ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://php:9000/var/www/html/$1
10+
DocumentRoot /var/www/html/
11+
<Directory /var/www/html/>
12+
DirectoryIndex index.php
13+
Options Indexes FollowSymLinks
14+
AllowOverride All
15+
Require all granted
16+
</Directory>
17+
18+
# Send apache logs to stdout and stderr
19+
CustomLog /proc/self/fd/1 common
20+
ErrorLog /proc/self/fd/2
21+
</VirtualHost>

docker-compose.yml

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
version: "3.2"
2+
services:
3+
php:
4+
build: './php/'
5+
networks:
6+
- backend
7+
volumes:
8+
- ./public_html/:/var/www/html/
9+
apache:
10+
build: './apache/'
11+
depends_on:
12+
- php
13+
# - db
14+
networks:
15+
- frontend
16+
- backend
17+
ports:
18+
- "8080:80"
19+
volumes:
20+
- ./public_html/:/var/www/html/
21+
db:
22+
image: mysql:5.7
23+
volumes:
24+
# - ./dump:/docker-entrypoint-initdb.d
25+
- db_data:/var/lib/mysql
26+
restart: always
27+
ports:
28+
- "3306:3306"
29+
networks:
30+
- backend
31+
environment:
32+
MYSQL_ROOT_PASSWORD: root
33+
# MYSQL_ROOT_HOST: db
34+
MYSQL_DATABASE: wordpress
35+
MYSQL_USER: wordpress
36+
MYSQL_PASSWORD: wordpress
37+
phpmyadmin:
38+
image: phpmyadmin/phpmyadmin
39+
networks:
40+
# - frontend
41+
- backend
42+
ports:
43+
- 8181:80
44+
depends_on:
45+
- php
46+
- apache
47+
- db
48+
# environment:
49+
# MYSQL_USERNAME: wordpress
50+
# MYSQL_ROOT_PASSWORD: root
51+
volumes:
52+
db_data:
53+
networks:
54+
frontend:
55+
backend:

php/Dockerfile

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM php:7.2.7-fpm-alpine3.7
2+
RUN apk update; \
3+
apk upgrade;
4+
RUN docker-php-ext-install mysqli

public_html/.gitignore

Whitespace-only changes.

0 commit comments

Comments
 (0)