Skip to content

Commit 02ac88e

Browse files
committed
refacto: Move some file to match with comment
1 parent 1ee2ec5 commit 02ac88e

File tree

28 files changed

+77
-139
lines changed

28 files changed

+77
-139
lines changed

.docker/php/conf.d/20-app.prod.ini

Lines changed: 0 additions & 3 deletions
This file was deleted.

.editorconfig

Lines changed: 0 additions & 10 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
###> docker file ###
55
docker.env.local
6-
.docker/data/history
6+
docker/data/history
77

88
deps.lock
99
.idea

Dockerfile

Lines changed: 0 additions & 104 deletions
This file was deleted.

Makefile

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ TEXT_BOLD = \033[1m
1414
##@ Setup 📜
1515
### Installer le projet from scratch
1616
install:
17-
cp -n .env.dist .env && cp -n docker.env docker.env.local && cp -n .docker/data/history.dist .docker/data/history && cp -n compose.override.yml-dist compose.override.yml
17+
cp -n .env.dist .env && cp -n docker.env docker.env.local && cp -n ./docker/data/history.dist ./docker/data/history && cp -n compose.override.yml-dist compose.override.yml
1818
mkdir -p ./htdocs/uploads -p ./tmp
1919

2020
$(DOCKER_COMPOSE_BIN) up -d --build
@@ -26,15 +26,15 @@ install:
2626
$(MAKE) --no-print-directory build-assets
2727

2828
# Reset la base de donnée
29-
cat ./.docker/mysql/reset-db.sql | $(DOCKER_COMPOSE_BIN) run -T --rm db /opt/mysql_no_db
29+
cat ./docker/mysql/reset-db.sql | $(DOCKER_COMPOSE_BIN) run -T --rm db /opt/mysql_no_db
3030

3131
$(DOCKER_COMPOSE_BIN) exec --user localUser apachephp php bin/phinx migrate
3232
$(DOCKER_COMPOSE_BIN) exec --user localUser apachephp php bin/phinx seed:run
3333

3434
### Supprime les volumes docker, les fichiers et les dossier généré par le projet
3535
reset:
3636
$(DOCKER_COMPOSE_BIN) down --remove-orphans -v
37-
rm -f ./.env -f ./docker.env.local -f .docker/data/history -f compose.override.yml
37+
rm -f ./.env -f ./docker.env.local -f ./docker/data/history -f compose.override.yml
3838
sudo rm -rf ./var ./vendor ./node_modules ./htdocs/bundles ./htdocs/docs ./htdocs/uploads ./htdocs/assets ./tmp
3939

4040
### Reinstalle le projet from scratch
@@ -81,13 +81,16 @@ cs-lint:
8181
cs-fix:
8282
$(DOCKER_COMPOSE_BIN) exec --user localUser apachephp ./bin/php-cs-fixer fix -vv
8383

84-
### (Dans Docker) Rector (dry run)
84+
### Rector (dry run)
8585
rector: var/cache/dev/AppKernelDevDebugContainer.xml
86-
./bin/rector --dry-run
86+
$(DOCKER_COMPOSE_BIN) exec --user localUser apachephp ./bin/rector --dry-run
8787

88-
### (Dans Docker) Rector (fix)
88+
### Rector (fix)
8989
rector-fix: var/cache/dev/AppKernelDevDebugContainer.xml
90-
./bin/rector
90+
$(DOCKER_COMPOSE_BIN) exec --user localUser apachephp ./bin/rector
91+
92+
var/cache/dev/AppKernelDevDebugContainer.xml:
93+
$(DOCKER_COMPOSE_BIN) exec --user localUser apachephp bin/console cache:warmup --env=dev
9194

9295
### Tests fonctionnels
9396
test-functional:
@@ -147,6 +150,3 @@ help:
147150

148151
.PHONY: install tests hooks console phpstan help
149152
.SILENT: help
150-
151-
var/cache/dev/AppKernelDevDebugContainer.xml:
152-
php bin/console cache:warmup --env=dev

compose.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
services:
22
apachephp:
33
build:
4-
context: .
4+
context: ./docker/apachephp
55
target: afup_web_dev
66
container_name: afup-web-apachephp
77
environment:
@@ -13,15 +13,15 @@ services:
1313
volumes:
1414
- ./:/var/www/html
1515
# Permet d'avoir un bash history ainsi que des alias bash quand on est dans le container
16-
- ./.docker/config/bashrc:/home/localUser/.bashrc
17-
- ./.docker/config/bash_aliases:/home/localUser/.bash_aliases
18-
- ./.docker/data/history:/home/localUser/.bash_history
16+
- ./docker/config/bashrc:/home/localUser/.bashrc
17+
- ./docker/config/bash_aliases:/home/localUser/.bash_aliases
18+
- ./docker/data/history:/home/localUser/.bash_history
1919
depends_on:
2020
- db
2121
- mailcatcher
2222

2323
db:
24-
build: ./docker/dockerfiles/mysql
24+
build: ./docker/mysql/dev
2525
container_name: afup-web-db
2626
environment:
2727
MYSQL_ROOT_PASSWORD: root
@@ -44,7 +44,7 @@ services:
4444
profiles: [front] # Avec ce paramètre node n'est pas lancé quand on docker compose up
4545

4646
dbtest:
47-
build: ./docker/dockerfiles/mysqltest
47+
build: ./docker/mysql/test
4848
container_name: afup-web-db-test
4949
environment:
5050
MYSQL_ROOT_PASSWORD: root
@@ -60,7 +60,7 @@ services:
6060

6161
apachephptest:
6262
build:
63-
context: .
63+
context: ./docker/apachephp
6464
target: afup_web_dev
6565
container_name: afup-web-apachephp-test
6666
environment:
@@ -74,9 +74,9 @@ services:
7474
volumes:
7575
- ./:/var/www/html
7676
# Permet d'avoir un bash history ainsi que des alias bash quand on est dans le container
77-
- ./.docker/config/bashrc:/localUser/.bashrc
78-
- ./.docker/config/bash_aliases:/localUser/.bash_aliases
79-
- ./.docker/data/history:/localUser/.bash_history
77+
- ./docker/config/bashrc:/localUser/.bashrc
78+
- ./docker/config/bash_aliases:/localUser/.bash_aliases
79+
- ./docker/data/history:/localUser/.bash_history
8080
healthcheck:
8181
test: [ "CMD", "curl", "-f", "https://apachephptest:80" ]
8282
interval: 30s
@@ -92,4 +92,4 @@ services:
9292
image: nginx:1.25.4
9393
container_name: afup-web-static
9494
volumes:
95-
- ./.docker/data/test/static-resources:/usr/share/nginx/html:ro
95+
- ./docker/data/test/static-resources:/usr/share/nginx/html:ro

docker/apachephp/Dockerfile

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
FROM php:8.2-apache AS afup_web_base
2+
3+
ARG UID=1008
4+
ARG GID=1008
5+
6+
WORKDIR /var/www/html
7+
8+
# Update package list and install system dependencies
9+
RUN apt-get update \
10+
&& apt-get install -y --no-install-recommends \
11+
acl \
12+
git \
13+
file \
14+
gettext \
15+
gosu; \
16+
rm -rf /var/lib/apt/lists/*; \
17+
# verify that the binary works
18+
gosu nobody true;
19+
20+
RUN groupadd -g ${GID} localUser && \
21+
useradd -l -u ${UID} -g ${GID} -m -s /bin/bash localUser && \
22+
usermod -a -G www-data localUser
23+
24+
ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
25+
26+
RUN set -eux; \
27+
install-php-extensions @composer-2.2.25 zip intl pdo_mysql mysqli gd opcache pcntl \
28+
;
29+
30+
COPY --link php/conf.d/10-app.ini $PHP_INI_DIR/conf.d/
31+
32+
COPY --link --chmod=755 php/docker-healthcheck.sh /usr/local/bin/docker-healthcheck
33+
HEALTHCHECK --start-period=1m CMD docker-healthcheck
34+
35+
COPY --link --chmod=755 php/docker-entrypoint.sh /usr/local/bin/docker-entrypoint
36+
37+
ENTRYPOINT ["docker-entrypoint"]
38+
CMD ["apache2-foreground"]
39+
40+
FROM afup_web_base AS afup_web_dev
41+
42+
COPY --link php/conf.d/20-app.dev.ini $PHP_INI_DIR/conf.d/
43+
44+
RUN set -eux; \
45+
install-php-extensions xdebug \
46+
;
47+
48+
COPY --link apache/apache.conf /etc/apache2/sites-available/000-default.conf
49+
COPY --link apache/cert/apache.crt /etc/apache2/ssl/apache.crt
50+
COPY --link apache/cert/apache.key /etc/apache2/ssl/apache.key
51+
52+
RUN sed --in-place "s/User \${APACHE_RUN_USER}/User localUser/" /etc/apache2/apache2.conf && \
53+
sed --in-place "s/Group \${APACHE_RUN_GROUP}/Group localUser/" /etc/apache2/apache2.conf && \
54+
a2ensite 000-default && \
55+
a2enmod rewrite ssl

0 commit comments

Comments
 (0)