Skip to content

Commit

Permalink
create new docker setup
Browse files Browse the repository at this point in the history
  • Loading branch information
BibaltiK committed Sep 13, 2023
1 parent 901d5ea commit fb3d7c1
Show file tree
Hide file tree
Showing 10 changed files with 637 additions and 54 deletions.
11 changes: 11 additions & 0 deletions .env.dist
Original file line number Diff line number Diff line change
@@ -1,2 +1,13 @@
ENV=dev
USERMAP_UID=1000
USERMAP_GID=984
MYSQL_USER=dev
MYSQL_PASSWORD=dev
MYSQL_ROOT_PASSWORD=root
MYSQL_DATABASE=db
MYSQL_PUBLIC_PORT=3306
PHP_VERSION=8.2
MARIADB_VERSION=latest
APACHE_VERSION=2.4-alpine
HTTP_PORT=80
SHTTP_PORT=443
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/tests/behat.yml
/tests/.phpunit.result.cache
/vendor/
/node_modules/
/client/node_modules/
/public/assets/*
*.cache
*.phar
Expand Down
6 changes: 3 additions & 3 deletions config/autoload/database.global.php.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

return [
'database' => [
'host' => 'hackathon-db',
'host' => 'mariadb',
'port' => '3306',
'user' => 'db',
'password' => 'db',
'user' => 'dev',
'password' => 'dev',
'dbname' => 'db',
'error' => PDO::ERRMODE_EXCEPTION,
]
Expand Down
49 changes: 29 additions & 20 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,40 @@
version: "3"
version: "3.8"

services:

webserver:
build: ./docker/webserver
user: "${USERMAP_UID}:${USERMAP_GID}"
container_name: hackathon_backend
apache:
image: httpd:alpine
container_name: apache
ports:
- "80:80"
- "${HTTP_PORT:-80}:80"
- "${SHTTP_PORT:-443}:443"
volumes:
- ./:/var/www/html
- ./docker/httpd.conf:/usr/local/apache2/conf/httpd.conf

php:
container_name: php
user: "${USERMAP_UID:-1000}:${USERMAP_GID:-1000}"
build:
context: ./docker/php
args:
PHP_VERSION: ${PHP_VERSION:-8.2}
ENV: ${ENV:-production}
volumes:
- ./:/var/www/html
- ./docker/xdebug.ini:/usr/local/etc/php/conf.d/xdebug.ini
- ./docker/php.ini:/usr/local/etc/php/conf.d/extra.ini
- ./.phpunit.cache/code-coverage:/opt/phpstorm-coverage
- ./docker/php/php-ini-overrides.ini:/usr/local/etc/php/conf.d/extra.ini

hackathon-db:
image: mariadb:10.9
container_name: hackathon_mariadb
database:
image: mariadb:${MARIADB_VERSION:-latest}
container_name: mariadb
ports:
- "3306:3306"
- "${MYSQL_PUBLIC_PORT:-3306}:3306"
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: db
MYSQL_USER: db
MYSQL_PASSWORD: db
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-root}
MYSQL_DATABASE: ${MYSQL_DATABASE:-db}
MYSQL_USER: ${MYSQL_USER:-dev}
MYSQL_PASSWORD: ${MYSQL_PASSWORD:-dev}
volumes:
- hackathon-db-data:/var/lib/mysql
- db:/var/lib/mysql

mailhog:
image: mailhog/mailhog
Expand All @@ -36,4 +45,4 @@ services:
- "8025:8025" # web ui

volumes:
hackathon-db-data:
db:
Loading

0 comments on commit fb3d7c1

Please sign in to comment.