Skip to content
This repository has been archived by the owner on Apr 3, 2022. It is now read-only.

Commit

Permalink
Change to Docker from Compose in build and test
Browse files Browse the repository at this point in the history
  • Loading branch information
munza committed Dec 22, 2021
1 parent faf3b2c commit 28ec082
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
uses: actions/checkout@v2

- name: Build Docker image
uses: make build
run: make build

- name: Run tests
uses: make test
run: make test
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
PROJECT_NAME="Lumen API Starter"
IMAGE_NAME="lumen-api-starter-app"

.PHONY: help

help:
@echo "\n\033[1;32m${PROJECT_NAME}\033[0m\n"
@echo "\033[4mCommands:\033[0m\n"
@echo "make [command]\n"
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-10s\033[0m %s\n", $$1, $$2}'
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' ${MAKEFILE_LIST} | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-10s\033[0m %s\n", $$1, $$2}'

build: ## Build all Docker images
@docker-compose build
@docker build . --file Dockerfile --tag ${IMAGE_NAME}:latest

up: ## Up all Docker services
@docker-compose up -d
Expand All @@ -30,4 +31,4 @@ composer: ## SSH into a Composer container
@docker run --rm -it -v $(PWD):/app composer:2 sh

test: ## Run PHPUnit tests
@docker-compose run --rm app vendor/bin/phpunit
@docker run --rm ${IMAGE_NAME}:latest vendor/bin/phpunit
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
build:
context: .
dockerfile: Dockerfile
container_name: lumen-app
container_name: lumen-api-starter-app
volumes:
- app-data:/var/www/html
- ./docker/php/php.ini:/usr/local/etc/php/php.ini
Expand All @@ -14,7 +14,7 @@ services:

server:
image: nginx:1-alpine
container_name: lumen-server
container_name: lumen-api-starter-server
ports:
- 8000:80
volumes:
Expand All @@ -25,7 +25,7 @@ services:

db:
image: mysql:8
container_name: lumen-db
container_name: lumen-api-starter-db
command: --default-authentication-plugin=mysql_native_password
ports:
- 33061:3306
Expand Down

0 comments on commit 28ec082

Please sign in to comment.