Cleanup the docker-compose for local testing
This commit is contained in:
1
.github/scripts/build.sh
vendored
1
.github/scripts/build.sh
vendored
@@ -30,6 +30,7 @@ declare -a remove_files=(
|
||||
intellij_style.xml
|
||||
config.php
|
||||
docker-compose.yml
|
||||
docker-compose.local.yml
|
||||
Makefile
|
||||
phpcs.xml
|
||||
phpunit.xml
|
||||
|
||||
14
Makefile
14
Makefile
@@ -109,17 +109,9 @@ reset-installer:
|
||||
@php artisan database:create --reset
|
||||
@php artisan migrate:refresh --seed
|
||||
|
||||
.PHONY: docker
|
||||
docker:
|
||||
@mkdir -p $(CURR_PATH)/tmp/mysql
|
||||
|
||||
-docker rm -f phpvms
|
||||
docker build -t phpvms .
|
||||
docker run --name=phpvms \
|
||||
-v $(CURR_PATH):/var/www/ \
|
||||
-v $(CURR_PATH)/tmp/mysql:/var/lib/mysql \
|
||||
-p 8080:80 \
|
||||
phpvms
|
||||
.PHONY: docker-test
|
||||
docker-test:
|
||||
@docker-compose -f docker-compose.yml -f docker-compose.local.yml up
|
||||
|
||||
.PHONY: docker-clean
|
||||
docker-clean:
|
||||
|
||||
@@ -1,62 +1,31 @@
|
||||
#
|
||||
# Run with either `make docker-test` or the following Docker command:
|
||||
# docker-compose -f docker-compose.yml -f docker-compose.local.yml up
|
||||
#
|
||||
---
|
||||
version: '3'
|
||||
services:
|
||||
# This is overriding the docker-compose.yaml file to have a localized version
|
||||
# of the contianer that you can use for building/testing
|
||||
app:
|
||||
# For your own docker-compose, use `image: phpvms:latest` instead of the build/context block
|
||||
build:
|
||||
context: .
|
||||
environment:
|
||||
DB_HOST: mysql
|
||||
REDIS_HOST: redis
|
||||
volumes:
|
||||
# Uncomment this line if you want to use this for local testing
|
||||
- ./:/var/www
|
||||
- ./app:/var/www/app
|
||||
- ./bootstrap:/var/www/bootstrap
|
||||
- ./config:/var/www/config
|
||||
- ./modules:/var/www/modules
|
||||
- ./public:/var/www/public
|
||||
- ./resources:/var/www/resources
|
||||
- ./storage:/var/www/storage
|
||||
- ./tests:/var/www/tests
|
||||
- ./composer.json:/var/www/composer.json
|
||||
- ./composer-lock.json:/var/www/composer-lock.json
|
||||
- ./env.php:/var/www/env.php
|
||||
- ./resources/docker/php/www.conf:/usr/local/etc/php-fpm.d/www.conf
|
||||
depends_on:
|
||||
- mysql
|
||||
- redis
|
||||
|
||||
nginx:
|
||||
image: nginx:1.15.12-alpine
|
||||
command: /bin/sh -c "exec nginx -g 'daemon off;'"
|
||||
volumes:
|
||||
- ./:/var/www
|
||||
- ./resources/docker/nginx/default.conf:/etc/nginx/conf.d/default.conf
|
||||
ports:
|
||||
- 80:80
|
||||
depends_on:
|
||||
- app
|
||||
|
||||
mysql:
|
||||
image: mysql:5.7
|
||||
command: "--innodb_use_native_aio=0"
|
||||
environment:
|
||||
MYSQL_DATABASE: phpvms
|
||||
MYSQL_USER: phpvms
|
||||
MYSQL_PASSWORD: phpvms
|
||||
MYSQL_ROOT_PASSWORD:
|
||||
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
|
||||
volumes:
|
||||
- ./storage/docker/mysql:/var/lib/mysql
|
||||
- ./resources/docker/mysql:/etc/mysql/conf.d
|
||||
ports:
|
||||
- 3306:3306
|
||||
|
||||
redis:
|
||||
image: redis:5.0.4-alpine
|
||||
command: ["redis-server", "--appendonly", "yes"]
|
||||
volumes:
|
||||
- ./storage/docker/redis:/data
|
||||
ports:
|
||||
- 6379:6379
|
||||
restart: always
|
||||
|
||||
# Use this to tail the logs so it's just all in a single window
|
||||
#logs:
|
||||
# image: busybox
|
||||
# command: tail -f -F -n 0 /var/www/storage/logs/laravel.log
|
||||
# restart: always
|
||||
# volumes:
|
||||
# - ./storage:/var/www/storage
|
||||
# depends_on:
|
||||
# - app
|
||||
|
||||
@@ -2,15 +2,11 @@
|
||||
version: '3'
|
||||
services:
|
||||
app:
|
||||
# For your own docker-compose, use `image: phpvms:latest` instead of the build/context block
|
||||
build:
|
||||
context: .
|
||||
image: phpvms:latest
|
||||
environment:
|
||||
DB_HOST: mysql
|
||||
REDIS_HOST: redis
|
||||
volumes:
|
||||
# Uncomment this line if you want to use this for local testing
|
||||
# - ./:/var/www
|
||||
- ./resources/docker/php/www.conf:/usr/local/etc/php-fpm.d/www.conf
|
||||
depends_on:
|
||||
- mysql
|
||||
|
||||
Reference in New Issue
Block a user