diff --git a/compose.yml b/compose.yml new file mode 100644 index 0000000..8618416 --- /dev/null +++ b/compose.yml @@ -0,0 +1,81 @@ +services: + nginx: + build: + context: .. + dockerfile: dockerfiles/nginx/Dockerfile + ports: + - "80:80" + depends_on: + - db + - etherpad + networks: + - app-network + + front: + build: + context: . + dockerfile: dockerfiles/front/Dockerfile + + ports: + - "5000:80" + volumes: + - ./doodlestudent/front:/app + environment: + - FLASK_ENV=development + networks: + - app-network + + back: + build: + context: . + dockerfile: dockerfiles/back/DockerfileUsingApiNative + ports: + - "8080:8080" + volumes: + - ./doodlestudent/api:/app + environment: + - FLASK_ENV=development + depends_on: + db: + condition: service_healthy + networks: + - app-network + + db: + image: mysql + ports: + - "3306:3306" + environment: + - MYSQL_ROOT_PASSWORD=root + - MYSQL_DATABASE=tlc + - MYSQL_USER=tlc + - MYSQL_PASSWORD=tlc + healthcheck: + test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u tlc", "-p tlc"] + interval: 5s + timeout: 5s + retries: 10 + networks: + - app-network + + etherpad: + image: etherpad/etherpad + ports: + - "9001:9001" + volumes: + - ./doodlestudent/api/APIKEY.txt:/opt/etherpad-lite/APIKEY.txt + networks: + - app-network + + mail: + image: bytemark/smtp + restart: always + ports: + - "2525:25" + networks: + - app-network + +networks: + app-network: + external: false + name: app-network \ No newline at end of file diff --git a/dockerfiles/back/DockerfileUsingApiNative b/dockerfiles/back/DockerfileUsingApiNative index d24c499..3ec6c40 100644 --- a/dockerfiles/back/DockerfileUsingApiNative +++ b/dockerfiles/back/DockerfileUsingApiNative @@ -29,6 +29,7 @@ RUN chown 1001 /work \ EXPOSE 8080 USER 1001 +#ENV quarkus_datasource_jdbc_url "jdbc:mysql://db:3306/tlc?allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true&serverTimezone=Europe/Paris" ENV quarkus_datasource_jdbc_url "jdbc:mysql://db:3306/tlc?allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true&serverTimezone=Europe/Paris" ENV quarkus_datasource_username tlc ENV quarkus_datasource_password tlc diff --git a/dockerfiles/front/Dockerfile b/dockerfiles/front/Dockerfile index 9e9b705..0515c40 100644 --- a/dockerfiles/front/Dockerfile +++ b/dockerfiles/front/Dockerfile @@ -14,7 +14,7 @@ FROM nginx:alpine COPY --from=build /app/dist/tlcfront /usr/share/nginx/html -EXPOSE 80 +EXPOSE 80 5000 CMD ["nginx", "-g", "daemon off;"] diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..e69de29