Commit f90b002e authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

MAJ docker

parent 2ea99090
Loading
Loading
Loading
Loading
Loading
+1 −0
Changes for .gitignore: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -15,3 +15,4 @@ composer.phar
.idea
/.php-cs-fixer.cache
supervisord.*
docker-compose.yaml
 No newline at end of file
+9 −26
Changes for Makefile: 9 added lines, 26 removed lines.
Original line number Diff line number Diff line
# On s'appuie sur le .env
include .env

ifeq ($(APP_ENV),dev)
    PROFILS := --profile dev
else
    PROFILS := --profile prod
endif

ifeq ($(MAIL_ENABLED),true)
    ifeq ($(MAIL_SMTP_HOST),)
        # Si le MAIL_SMTP_HOST n'est pas renseigné, alors on va utiliser un mailer local pour récupérer les mails
        # S'il est renseigné, alors on considère qu'on va utiliser un serveur SMTP externe
        PROFILS += --profile mail
    endif
endif

ALL_PROFILS := --profile dev --profile prod --profile bdd --profile mail



# Commandes
help:
@@ -31,26 +14,26 @@ help:


install: ## Build des conteneurs de l'application
	docker compose $(PROFILS) up -d
	docker compose up -d
.PHONY: install



uninstall: ## Désinstallation
	docker compose $(ALL_PROFILS) down --rmi all --volumes --remove-orphans
	docker compose down --rmi all --volumes --remove-orphans
	docker network rm $(APP_NAME)-network -f
.PHONY: uninstall



start: ## Démarre les conteneurs de l'application
	docker compose $(PROFILS) start
	docker compose start
.PHONY: start



stop: ## Stoppe les conteneurs de l'application
	docker compose $(PROFILS) stop
	docker compose stop
.PHONY: stop


@@ -74,7 +57,7 @@ bash-node: ## Entrer dans le container Node.js


logs: ## Afficher les logs des containers docker
	docker compose $(PROFILS) logs -f --tail=100
	docker compose logs -f --tail=100
.PHONY: logs


@@ -99,9 +82,9 @@ clear-cache: ## Vide le cache de l'application


rebuild: ## Reconstruit tous les conteneurs
	docker compose $(ALL_PROFILS) down -v
	docker compose $(PROFILS) build --no-cache
	docker compose $(PROFILS) up -d
	docker compose down -v
	docker compose build --no-cache
	docker compose up -d
.PHONY: rebuild


@@ -121,7 +104,7 @@ clean: ## Vide les caches Docker
	@echo ""
	@read -p "Confirmez-vous ce nettoyage complet ? [o/N] " confirm; \
	if [ "$$confirm" = "o" ] || [ "$$confirm" = "O" ]; then \
		docker compose $(PROFILS) down -v; \
		docker compose down -v; \
		docker system prune -af --volumes; \
		echo "Ménage fait"; \
	else \
+9 −0
Changes for doc/dev-infra/Caddyfile: 9 added lines, 0 removed lines.
Original line number Diff line number Diff line
ose-dev.localhost.unicaen.fr {
    tls /certs/localhost.unicaen.fr.crt /certs/localhost.unicaen.fr.key
    reverse_proxy ose-dev-apache:80
}

ose-dev.localhost.unicaen.fr:5133 {
    tls /certs/localhost.unicaen.fr.crt /certs/localhost.unicaen.fr.key
    reverse_proxy ose-dev-nodejs:5133
}
 No newline at end of file
+4 −20
Changes for docker-compose.yaml.example: 4 added lines, 20 removed lines.
Original line number Diff line number Diff line
@@ -4,23 +4,18 @@ services:
    extends:
      file: docker/php/docker-compose.yaml
      service: php
    profiles:
      - dev
      - prod
    # si besoin utiliser xdebug sur machine hôte
    extra_hosts:
      - "host.docker.internal:host-gateway"
    networks:
      - app-network
      - laures

  nodejs:
    extends:
      file: docker/nodejs/docker-compose.yaml
      service: nodejs
    profiles:
      - dev
    ports:
      - ${APP_VITE_PORT:-5133}:5133
      - 5133:5133
    networks:
      - app-network

@@ -28,11 +23,8 @@ services:
    extends:
      file: docker/apache/docker-compose.yaml
      service: apache
    profiles:
      - dev
      - prod
    ports:
      - ${APP_FRONT_PORT:-80}:80
      - 8080:80
    networks:
      - app-network

@@ -40,10 +32,8 @@ services:
    extends:
      file: docker/maildev/docker-compose.yaml
      service: maildev
    profiles:
      - mail
    ports:
      - ${MAIL_MAILDEV_PORT:-1080}:80
      - 1080:80
    networks:
      - app-network

@@ -51,9 +41,6 @@ services:
    extends:
      file: docker/odconv/docker-compose.yaml
      service: odconv
    profiles:
      - dev
      - prod
    networks:
      - app-network

@@ -61,6 +48,3 @@ networks:
  app-network:
    name: ${APP_NAME:-ose}-network
    driver: bridge

  laures:
    external: true
 No newline at end of file
+4 −4
Changes for docker/apache/Dockerfile: 4 added lines, 4 removed lines.
Original line number Diff line number Diff line
FROM httpd:2.4-alpine

ARG APP_TZ
ARG TZ

# Met à jour la liste des paquets
RUN apk update

# Configuration du fuseau horaire sur Paris
ENV TZ=$APP_TZ
ENV TZ=$TZ
RUN apk add --no-cache tzdata && \
    cp /usr/share/zoneinfo/$APP_TZ /etc/localtime && \
    echo $APP_TZ > /etc/timezone
    cp /usr/share/zoneinfo/$TZ /etc/localtime && \
    echo $TZ > /etc/timezone

# Installation de supervisor et apache2-utils
RUN apk add --no-cache supervisor
Loading