Skip to content

Commit a9f467a

Browse files
committed
add: docker compose
1 parent 1d07ec6 commit a9f467a

File tree

4 files changed

+68
-0
lines changed

4 files changed

+68
-0
lines changed

.dockerignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Caddyfile
2+
3+
.github
4+
.vscode

Caddyfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
localhost {
2+
root * /app/public
3+
php_fastcgi php-fpm:9000
4+
file_server
5+
}

Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM php:7.3-fpm
2+
3+
RUN apt-get update -y
4+
RUN docker-php-ext-install mysqli pdo pdo_mysql && docker-php-ext-enable pdo_mysql

docker-compose.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
version: '3.3'
2+
3+
services:
4+
caddy:
5+
container_name: caddy
6+
image: caddy
7+
restart: unless-stopped
8+
ports:
9+
- "80:80"
10+
- "443:443"
11+
volumes:
12+
- ./Caddyfile:/etc/caddy/Caddyfile
13+
- .:/app/public
14+
- caddy_data:/data
15+
- caddy_config:/config
16+
depends_on:
17+
- php-fpm
18+
php-fpm:
19+
container_name: php-fpm
20+
build: .
21+
restart: unless-stopped
22+
volumes:
23+
- .:/app/public
24+
depends_on:
25+
- database
26+
database:
27+
image: mysql:5.7
28+
ports:
29+
- 3306:3306
30+
environment:
31+
- MYSQL_HOST=database
32+
- MYSQL_PORT=3306
33+
- MYSQL_DATABASE=evoting
34+
- MYSQL_USER=ci
35+
- MYSQL_PASSWORD=ci
36+
- MYSQL_ROOT_PASSWORD=ci
37+
phpmyadmin:
38+
depends_on:
39+
- database
40+
image: phpmyadmin/phpmyadmin
41+
restart: always
42+
ports:
43+
- '8282:80'
44+
environment:
45+
- PHP_ENABLE_XDEBUG=0
46+
- PMA_HOST=database
47+
48+
volumes:
49+
caddy_data:
50+
caddy_config:
51+
52+
networks:
53+
default:
54+
external:
55+
name: main

0 commit comments

Comments
 (0)