Skip to content

Commit 1ebe6e7

Browse files
committed
Add some fixes
1 parent 561eb0a commit 1ebe6e7

File tree

2 files changed

+25
-13
lines changed

2 files changed

+25
-13
lines changed

Dockerfile

+4-2
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,15 @@ ARG APCU_VERSION
1616

1717
WORKDIR /app
1818

19+
EXPOSE 80
20+
1921
# Install paquet requirements
2022
RUN export PHP_CPPFLAGS="${PHP_CPPFLAGS} -std=c++11"; \
2123
set -ex; \
2224
# Install required system packages
2325
apt-get update; \
2426
apt-get install -qy --no-install-recommends \
2527
libzip-dev \
26-
git \
2728
; \
2829
# Compile ICU (required by intl php extension)
2930
curl -L -o /tmp/icu.tar.gz http://download.icu-project.org/files/icu4c/${ICU_VERSION}/icu4c-$(echo ${ICU_VERSION} | sed s/\\./_/g)-src.tgz; \
@@ -98,6 +99,7 @@ RUN set -ex; \
9899
apt-get update; \
99100
apt-get install -qy --no-install-recommends \
100101
unzip \
102+
git \
101103
; \
102104
# Clean aptitude cache and tmp directory
103105
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*;
@@ -154,7 +156,7 @@ RUN yarn install && yarn build && rm -R node_modules
154156
#####################################
155157
FROM composer:${COMPOSER_VERSION} as vendor-builder
156158

157-
COPY --from=assets-builder /app /app
159+
COPY --chown=www-data --from=assets-builder /app /app
158160
WORKDIR /app
159161

160162
RUN APP_ENV=prod composer install -o -n --no-ansi --no-dev

Makefile

+21-11
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
DOCKER_COMPOSE?=docker-compose
22
EXEC?=$(DOCKER_COMPOSE) exec app
3-
CONSOLE=bin/console
3+
CONSOLE=php bin/console
44
PHPCSFIXER?=$(EXEC) php -d memory_limit=1024m vendor/bin/php-cs-fixer
55

66
.DEFAULT_GOAL := help
77
.PHONY: help start stop restart install uninstall reset clear-cache shell clear clean
88
.PHONY: db-diff db-migrate db-rollback db-fixtures db-validate
99
.PHONY: watch assets assets-build
1010
.PHONY: tests lint lint-symfony lint-yaml lint-twig lint-xliff php-cs php-cs-fix security-check test-schema test-all
11-
.PHONY: build up perm
12-
.PHONY: docker-compose.override.yml
11+
.PHONY: deps
12+
.PHONY: build up perm docker-compose.override.yml
1313

1414
help:
1515
@grep -E '(^[a-zA-Z_-]+:.*?##.*$$)|(^##)' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[32m%-30s\033[0m %s\n", $$1, $$2}' | sed -e 's/\[32m##/[33m/'
1616

17+
1718
##
1819
## Project setup
1920
##---------------------------------------------------------------------------
@@ -27,7 +28,7 @@ stop:
2728
restart: ## Restart docker containers
2829
$(DOCKER_COMPOSE) restart
2930

30-
install: docker-compose.override.yml build up vendor perm ## Create and start docker containers
31+
install: docker-compose.override.yml build up deps perm ## Create and start docker containers
3132

3233
uninstall: stop ## Remove docker containers
3334
$(DOCKER_COMPOSE) rm -vf
@@ -48,7 +49,7 @@ clear: perm
4849
rm -f var/.php_cs.cache
4950

5051
clean: clear ## Clear and remove dependencies
51-
rm -rf vendor
52+
rm -rf vendor node_modules
5253

5354

5455
##
@@ -81,17 +82,18 @@ watch: node_modules
8182
assets: node_modules ## Build the development version of the assets
8283
$(EXEC) yarn dev
8384

84-
assets-build: node_modules ## Build the production version of the assets
85+
assets-build: node_modules ## Build the production version of the assets
8586
$(EXEC) yarn build
8687

88+
8789
##
8890
## Tests
8991
##---------------------------------------------------------------------------
9092

9193
tests: ## Run all the PHP tests
9294
$(EXEC) bin/phpunit
9395

94-
lint: lint-symfony php-cs ## Run lint on Twig, YAML, PHP and Javascript files
96+
lint: lint-symfony php-cs ## Run lint on Twig, YAML, XLIFF, and PHP files
9597

9698
lint-symfony: lint-yaml lint-twig lint-xliff ## Lint Symfony (Twig and YAML) files
9799

@@ -101,13 +103,13 @@ lint-yaml:
101103
lint-twig: ## Lint Twig files
102104
$(EXEC) $(CONSOLE) lint:twig templates
103105

104-
lint-xliff: ## Lint Translation files
106+
lint-xliff: ## Lint Translation files
105107
$(EXEC) $(CONSOLE) lint:xliff translations
106108

107109
php-cs: vendor ## Lint PHP code
108110
$(PHPCSFIXER) fix --diff --dry-run --no-interaction -v
109111

110-
php-cs-fix: vendor ## Lint and fix PHP code to follow the convention
112+
php-cs-fix: vendor ## Fix PHP code to follow the convention
111113
$(PHPCSFIXER) fix
112114

113115
security-check: vendor ## Check for vulnerable dependencies
@@ -116,7 +118,15 @@ security-check: vendor
116118
test-schema: vendor ## Test the doctrine Schema
117119
$(EXEC) $(CONSOLE) doctrine:schema:validate --skip-sync -vvv --no-interaction
118120

119-
test-all: lint test-schema security-check tests ## Lint all, check vulnerable dependencies, run PHP tests
121+
test-all: lint test-schema security-check tests ## Lint all, run schema and security check, then unit and functionnal tests
122+
123+
124+
##
125+
## Dependencies
126+
##---------------------------------------------------------------------------
127+
128+
deps: vendor assets ## Install the project dependencies
129+
120130

121131
##
122132

@@ -147,7 +157,7 @@ vendor: composer.lock
147157
$(EXEC) composer install -n
148158

149159
composer.lock: composer.json
150-
@echo compose.lock is not up to date.
160+
@echo composer.lock is not up to date.
151161

152162
node_modules: yarn.lock
153163
$(EXEC) yarn install

0 commit comments

Comments
 (0)