Skip to content

Commit

Permalink
Merge pull request #114 from alexandrechevalierCBH/configuration
Browse files Browse the repository at this point in the history
Configuration - Transport
  • Loading branch information
alexandrechevalierCBH authored Dec 11, 2023
2 parents 301175f + e3e5ee2 commit a1a4341
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 46 deletions.
1 change: 1 addition & 0 deletions .env.dist
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ MYSQL_VERSION=8.0.27
MYSQL_DATABASE=databasorus
MYSQL_USER=user
MYSQL_PASSWORD=password
MAILER_DSN=smtp://mailhog:1025
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
###< phpunit/phpunit ###

.env
docker-compose.override.yml
docker compose.override.yml
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
.PHONY: start
start: cp-env build install-deps
docker-compose up -d
docker compose up -d

.PHONY: cp-env
cp-env:
@cp -n .env.dist .env || true

.PHONY: build
build:
docker-compose build
docker compose build

.PHONY: install-deps
install-deps:
docker-compose run --rm php composer install
docker compose run --rm php composer install

.PHONY: database-migrate
database-migrate:
docker-compose run --rm php bin/console doctrine:migrations:migrate
docker compose run --rm php bin/console doctrine:migrations:migrate

.PHONY: database-create
database-create:
docker-compose run --rm php bin/console doctrine:database:create
docker compose run --rm php bin/console doctrine:database:create

.PHONY: database-drop
database-drop:
docker-compose run --rm php bin/console doctrine:database:drop --if-exists --force
docker compose run --rm php bin/console doctrine:database:drop --if-exists --force

.PHONY: fixtures-load
fixtures-load:
docker-compose run --rm php bin/console doctrine:fixtures:load
docker compose run --rm php bin/console doctrine:fixtures:load

.PHONY: reset-db
reset-db: database-drop database-create database-migrate fixtures-load
76 changes: 38 additions & 38 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
---
version: '3'
version: "3"

services:
php:
platform: linux/x86_64
build:
context: .
dockerfile: Dockerfile
env_file: .env
volumes:
- '.:/usr/src/app'
restart: unless-stopped
php:
platform: linux/x86_64
build:
context: .
dockerfile: Dockerfile
env_file: .env
volumes:
- ".:/usr/src/app"
restart: unless-stopped

nginx:
platform: linux/x86_64
image: nginx:1.21.3-alpine
ports:
- 80:80
volumes:
- ./docker/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./public:/usr/src/app/public
restart: unless-stopped
nginx:
platform: linux/x86_64
image: nginx:1.21.3-alpine
ports:
- 80:80
volumes:
- ./docker/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./public:/usr/src/app/public
restart: unless-stopped

# phpmyadmin:
# platform: linux/x86_64
# image: phpmyadmin
# environment:
# - PMA_ARBITRARY=1
# ports:
# - 8080:80
# restart: unless-stopped
phpmyadmin:
platform: linux/x86_64
image: phpmyadmin
environment:
- PMA_ARBITRARY=1
ports:
- 8080:80
restart: unless-stopped

database:
image: mysql:8.0.27
environment:
MYSQL_RANDOM_ROOT_PASSWORD: "yes"
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
MYSQL_USER: ${MYSQL_USER}
volumes:
- db-data:/var/lib/mysql:rw
restart: unless-stopped
database:
image: mysql:8.0.27
environment:
MYSQL_RANDOM_ROOT_PASSWORD: "yes"
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
MYSQL_USER: ${MYSQL_USER}
volumes:
- db-data:/var/lib/mysql:rw
restart: unless-stopped

volumes:
db-data: ~
db-data: ~

0 comments on commit a1a4341

Please sign in to comment.