From 008a0b901f14a8e69618fa31cb945adeece2428f Mon Sep 17 00:00:00 2001 From: "guilhem.carron" <gcarron@grandlyon.com> Date: Fri, 6 Aug 2021 10:45:50 +0200 Subject: [PATCH] add docker compose --- docker-compose.old.yml | 32 +++++++++++++++++++++ docker-compose.pro.yml | 9 ------ docker-compose.yml | 65 +++++++++++++++++++++++++++++++----------- 3 files changed, 80 insertions(+), 26 deletions(-) create mode 100644 docker-compose.old.yml delete mode 100644 docker-compose.pro.yml diff --git a/docker-compose.old.yml b/docker-compose.old.yml new file mode 100644 index 00000000..7d966d37 --- /dev/null +++ b/docker-compose.old.yml @@ -0,0 +1,32 @@ +version: '3.7' +services: + nginx: + image: nginx:1.16 + restart: unless-stopped + volumes: + - ./nginx/site.conf:/etc/nginx/conf.d/default.conf + - ./nginx/nginx.conf:/etc/nginx/nginx.conf + command: ["nginx", "-g", "daemon off;"] + ports: + - 8081:8080 + networks: + backoffice: + depends_on: + - front + links: + - front + + front: + image: bayesimpact/react-base + restart: unless-stopped + volumes: + - ./:/usr/app + working_dir: /usr/app + ports: + - 3000:3000 + networks: + backoffice: + +networks: + backoffice: + \ No newline at end of file diff --git a/docker-compose.pro.yml b/docker-compose.pro.yml deleted file mode 100644 index b69125f9..00000000 --- a/docker-compose.pro.yml +++ /dev/null @@ -1,9 +0,0 @@ -version: '3.7' -services: - nginx: - image: backoffice #TODO: replace with forge image tag - build: - context: . - restart: unless-stopped - ports: - - 8080:80 diff --git a/docker-compose.yml b/docker-compose.yml index 7d966d37..6fbcdebb 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,32 +1,63 @@ version: '3.7' services: nginx: - image: nginx:1.16 + image: test restart: unless-stopped + ports: + - 8080:8080 + networks: + backoffice: volumes: - ./nginx/site.conf:/etc/nginx/conf.d/default.conf - - ./nginx/nginx.conf:/etc/nginx/nginx.conf - command: ["nginx", "-g", "daemon off;"] + - ./cert.pem:/etc/nginx/cert.pem + - ./key.pem:/etc/nginx/key.pem + + database: + image: mysql:5 ports: - - 8081:8080 + - 3306:3306 networks: backoffice: - depends_on: - - front - links: - - front + environment: + MYSQL_ROOT_PASSWORD: ${DATABASE_PASSWORD} + MYSQL_DATABASE: ${DATABASE_NAME} + healthcheck: + test: mysqladmin ping -h 127.0.0.1 -u root --password=$$MYSQL_ROOT_PASSWORD + interval: 5s + timeout: 10s + retries: 60 - front: - image: bayesimpact/react-base + backend: + image: registry.forge.grandlyon.com/web-et-numerique/llle_project/backoffice-server:test + networks: + backoffice: + depends_on: + database: + condition: service_healthy restart: unless-stopped volumes: - - ./:/usr/app - working_dir: /usr/app + - /etc/localtime:/etc/localtime:ro + - ./configs:/app/configs + - ./letsencrypt_cache:/app/letsencrypt_cache + - ./data:/app/data ports: - - 3000:3000 - networks: - backoffice: + - ${HTTPS_PORT}:${HTTPS_PORT} + - 8090:8090 + environment: + - HOSTNAME=${HOSTNAME} + - HTTPS_PORT=${HTTPS_PORT} + - ADMIN_ROLE=${ADMIN_ROLE} + - REDIRECT_URL=${REDIRECT_URL} + - CLIENT_ID=${CLIENT_ID} + - CLIENT_SECRET=${CLIENT_SECRET} + - AUTH_URL=${AUTH_URL} + - TOKEN_URL=${TOKEN_URL} + - USERINFO_URL=${USERINFO_URL} + - DEBUG_MODE=${DEBUG_MODE} + - DATABASE_USER=${DATABASE_USER} + - DATABASE_NAME=${DATABASE_NAME} + - DATABASE_PASSWORD=${DATABASE_PASSWORD} + - DATABASE_HOST=database networks: - backoffice: - \ No newline at end of file + backoffice: -- GitLab