Skip to content

Commit

Permalink
add: docker compose
Browse files Browse the repository at this point in the history
  • Loading branch information
manh21 committed Mar 22, 2023
1 parent 1d07ec6 commit a9f467a
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Caddyfile

.github
.vscode
5 changes: 5 additions & 0 deletions Caddyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
localhost {
root * /app/public
php_fastcgi php-fpm:9000
file_server
}
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM php:7.3-fpm

RUN apt-get update -y
RUN docker-php-ext-install mysqli pdo pdo_mysql && docker-php-ext-enable pdo_mysql
55 changes: 55 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
version: '3.3'

services:
caddy:
container_name: caddy
image: caddy
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
- .:/app/public
- caddy_data:/data
- caddy_config:/config
depends_on:
- php-fpm
php-fpm:
container_name: php-fpm
build: .
restart: unless-stopped
volumes:
- .:/app/public
depends_on:
- database
database:
image: mysql:5.7
ports:
- 3306:3306
environment:
- MYSQL_HOST=database
- MYSQL_PORT=3306
- MYSQL_DATABASE=evoting
- MYSQL_USER=ci
- MYSQL_PASSWORD=ci
- MYSQL_ROOT_PASSWORD=ci
phpmyadmin:
depends_on:
- database
image: phpmyadmin/phpmyadmin
restart: always
ports:
- '8282:80'
environment:
- PHP_ENABLE_XDEBUG=0
- PMA_HOST=database

volumes:
caddy_data:
caddy_config:

networks:
default:
external:
name: main

0 comments on commit a9f467a

Please sign in to comment.