add development and production targets; run phpunit in container
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
2a0af653cb
commit
9095a604a2
|
|
@ -29,13 +29,13 @@ steps:
|
|||
commands:
|
||||
- composer install --no-progress --no-interaction --no-dev --optimize-autoloader
|
||||
|
||||
- name: build image
|
||||
- name: build production image
|
||||
image: docker
|
||||
volumes:
|
||||
- name: dockersock
|
||||
path: /var/run/docker.sock
|
||||
commands:
|
||||
- docker build -t notecat:latest .
|
||||
- docker build --target production -t notecat:latest .
|
||||
|
||||
- name: deploy on testing
|
||||
image: docker/compose
|
||||
|
|
|
|||
13
Dockerfile
13
Dockerfile
|
|
@ -1,9 +1,20 @@
|
|||
FROM php:7.4-apache
|
||||
FROM php:7.4-apache AS base
|
||||
|
||||
WORKDIR /var/www
|
||||
|
||||
RUN sed -ri -e 's!/var/www/html!/var/www/public!g' /etc/apache2/sites-available/*.conf
|
||||
|
||||
|
||||
FROM base AS development
|
||||
|
||||
RUN cp $PHP_INI_DIR/php.ini-development $PHP_INI_DIR/php.ini
|
||||
RUN pecl install xdebug && docker-php-ext-enable xdebug
|
||||
|
||||
|
||||
FROM base AS production
|
||||
|
||||
RUN cp $PHP_INI_DIR/php.ini-production $PHP_INI_DIR/php.ini
|
||||
|
||||
COPY vendor/ /var/www/vendor/
|
||||
COPY public/ /var/www/public/
|
||||
COPY src/ /var/www/src/
|
||||
|
|
|
|||
2
Makefile
2
Makefile
|
|
@ -29,7 +29,7 @@ install:
|
|||
test: phpunit
|
||||
|
||||
phpunit:
|
||||
${PHPUNIT} -c phpunit.xml
|
||||
${DOCKER_COMPOSE_CMD} run web ${PHPUNIT} -c phpunit.xml
|
||||
|
||||
open_coverage:
|
||||
${BROWSER} coverage/index.html
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
version: '3'
|
||||
version: '3.4'
|
||||
|
||||
services:
|
||||
web:
|
||||
build: ..
|
||||
build:
|
||||
context: ..
|
||||
target: development
|
||||
restart: always
|
||||
ports:
|
||||
- 8080:80
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
version: '3'
|
||||
version: '3.4'
|
||||
|
||||
services:
|
||||
web:
|
||||
build: ..
|
||||
build:
|
||||
context: ..
|
||||
target: production
|
||||
restart: always
|
||||
networks:
|
||||
- traefik
|
||||
|
|
|
|||
Loading…
Reference in New Issue