suppr fichiers inutiles
This commit is contained in:
@@ -26,13 +26,13 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
- front
|
- front
|
||||||
volumes:
|
volumes:
|
||||||
- ./certbot/www/:/var/www/certbot/:rw
|
- ../certbot/www/:/var/www/certbot/:rw
|
||||||
- ./certbot/conf/:/etc/letsencrypt/:rw
|
- ../certbot/conf/:/etc/letsencrypt/:rw
|
||||||
|
|
||||||
back:
|
back:
|
||||||
build:
|
build:
|
||||||
context: ..
|
context: ..
|
||||||
dockerfile: dockerfiles/back/DockerfileUsingApiNative
|
dockerfile: dockerfiles/back/Dockerfile
|
||||||
ports:
|
ports:
|
||||||
- "8080:8080"
|
- "8080:8080"
|
||||||
volumes:
|
volumes:
|
||||||
|
|||||||
@@ -1,18 +1,40 @@
|
|||||||
FROM alpine:3.23
|
FROM quay.io/quarkus/ubi-quarkus-mandrel-builder-image:23.0-java17 AS builder
|
||||||
|
|
||||||
RUN apk --no-cache add curl bash
|
# a executer a la racine du projet
|
||||||
|
|
||||||
# java 17 car c'est la version utilise dans maven (voir pom.xml)
|
USER root
|
||||||
RUN apk --no-cache add openjdk17-jdk maven
|
RUN microdnf install -y maven
|
||||||
|
|
||||||
COPY doodlestudent/api /app
|
COPY doodlestudent/api /app
|
||||||
|
|
||||||
RUN mvn install -Dpackaging=jar
|
WORKDIR /app
|
||||||
RUN mvn package -DskipTests
|
|
||||||
|
RUN ./mvnw dependency:resolve
|
||||||
|
|
||||||
|
COPY doodlestudent/api/src /app/src
|
||||||
|
RUN ./mvnw package -Pnative -DskipTests
|
||||||
|
|
||||||
RUN ls -l target
|
RUN ls -l target
|
||||||
|
|
||||||
# Quarkus semble utilise le port 8080 par defaut
|
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.8
|
||||||
EXPOSE 8080
|
|
||||||
|
|
||||||
ENTRYPOINT [ "java", "-jar", "/app/target/tlcdemoApp-1.0.0-SNAPSHOT.jar" ]
|
WORKDIR /work/
|
||||||
|
|
||||||
|
COPY --from=builder --chown=1001:root /app/target/*-runner /work/application
|
||||||
|
|
||||||
|
RUN chown 1001 /work \
|
||||||
|
&& chmod "g+rwX" /work \
|
||||||
|
&& chown 1001:root /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_username tlc
|
||||||
|
ENV quarkus_datasource_password tlc
|
||||||
|
ENV QUARKUS_HIBERNATE_ORM_DATABASE_GENERATION update
|
||||||
|
ENV doodle_internalPadUrl "http://etherpad:9001/"
|
||||||
|
ENV doodle_externalPadUrl "http://etherpad:9001/"
|
||||||
|
ENV mailer_host mail
|
||||||
|
ENV mailer_port 25
|
||||||
|
CMD ["./application", "-Dquarkus.http.host=0.0.0.0"]
|
||||||
|
|||||||
@@ -1,31 +0,0 @@
|
|||||||
FROM maven:3.9.6-eclipse-temurin-17 AS build
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
# Copy only pom.xml first (better layer caching)
|
|
||||||
COPY doodlestudent/api/pom.xml .
|
|
||||||
|
|
||||||
# Download dependencies
|
|
||||||
RUN mvn dependency:go-offline
|
|
||||||
|
|
||||||
# Copy the rest of the source code
|
|
||||||
COPY doodlestudent/api/src ./src
|
|
||||||
|
|
||||||
# Build the application
|
|
||||||
RUN mvn package -DskipTests
|
|
||||||
|
|
||||||
# ---------------------------
|
|
||||||
# Stage 2 - Runtime
|
|
||||||
# ---------------------------
|
|
||||||
FROM eclipse-temurin:17-jre-alpine
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
# Copy the built application from the build stage
|
|
||||||
COPY --from=build /app/target/quarkus-app/ ./quarkus-app/
|
|
||||||
|
|
||||||
# Quarkus default port
|
|
||||||
EXPOSE 8080
|
|
||||||
|
|
||||||
# Run the application
|
|
||||||
ENTRYPOINT ["java", "-jar", "quarkus-app/quarkus-run.jar"]
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
FROM quay.io/quarkus/ubi-quarkus-mandrel-builder-image:23.0-java17 AS builder
|
|
||||||
|
|
||||||
# a executer a la racine du projet
|
|
||||||
|
|
||||||
USER root
|
|
||||||
RUN microdnf install -y maven
|
|
||||||
|
|
||||||
COPY doodlestudent/api /app
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
RUN ./mvnw dependency:resolve
|
|
||||||
|
|
||||||
COPY doodlestudent/api/src /app/src
|
|
||||||
RUN ./mvnw package -Pnative -DskipTests
|
|
||||||
|
|
||||||
RUN ls -l target
|
|
||||||
|
|
||||||
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.8
|
|
||||||
|
|
||||||
WORKDIR /work/
|
|
||||||
|
|
||||||
COPY --from=builder --chown=1001:root /app/target/*-runner /work/application
|
|
||||||
|
|
||||||
RUN chown 1001 /work \
|
|
||||||
&& chmod "g+rwX" /work \
|
|
||||||
&& chown 1001:root /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_username tlc
|
|
||||||
ENV quarkus_datasource_password tlc
|
|
||||||
ENV QUARKUS_HIBERNATE_ORM_DATABASE_GENERATION update
|
|
||||||
ENV doodle_internalPadUrl "http://etherpad:9001/"
|
|
||||||
ENV doodle_externalPadUrl "http://etherpad:9001/"
|
|
||||||
ENV mailer_host mail
|
|
||||||
ENV mailer_port 25
|
|
||||||
CMD ["./application", "-Dquarkus.http.host=0.0.0.0"]
|
|
||||||
@@ -1,95 +0,0 @@
|
|||||||
services:
|
|
||||||
front:
|
|
||||||
build:
|
|
||||||
context: ..
|
|
||||||
dockerfile: dockerfiles/front/Dockerfile
|
|
||||||
ports:
|
|
||||||
- "80:80"
|
|
||||||
volumes:
|
|
||||||
- ../doodlestudent/front:/app
|
|
||||||
- ./certbot/www:/var/www/certbot:ro
|
|
||||||
- ./certbot/conf:/etc/letsencrypt:ro
|
|
||||||
environment:
|
|
||||||
- FLASK_ENV=development
|
|
||||||
depends_on:
|
|
||||||
- back
|
|
||||||
- db
|
|
||||||
- etherpad
|
|
||||||
- mail
|
|
||||||
networks:
|
|
||||||
- app-network
|
|
||||||
|
|
||||||
# https://stackoverflow.com/questions/57591868/how-correctly-install-ssl-certificate-using-certbot-in-docker
|
|
||||||
certbot:
|
|
||||||
image: certbot/certbot:latest
|
|
||||||
container_name: certbot
|
|
||||||
depends_on:
|
|
||||||
- front
|
|
||||||
volumes:
|
|
||||||
- ./certbot/www/:/var/www/certbot/:rw
|
|
||||||
- ./certbot/conf/:/etc/letsencrypt/:rw
|
|
||||||
|
|
||||||
back:
|
|
||||||
build:
|
|
||||||
context: ..
|
|
||||||
dockerfile: dockerfiles/back/DockerfileUsingApiNative
|
|
||||||
ports:
|
|
||||||
- "8080:8080"
|
|
||||||
volumes:
|
|
||||||
- ../doodlestudent/api:/app
|
|
||||||
environment:
|
|
||||||
- FLASK_ENV=development
|
|
||||||
depends_on:
|
|
||||||
db:
|
|
||||||
condition: service_healthy
|
|
||||||
etherpad:
|
|
||||||
condition: service_healthy
|
|
||||||
networks:
|
|
||||||
- app-network
|
|
||||||
restart:
|
|
||||||
unless-stopped
|
|
||||||
|
|
||||||
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", "-uroot", "-proot"]
|
|
||||||
interval: 10s
|
|
||||||
timeout: 1m
|
|
||||||
retries: 5
|
|
||||||
networks:
|
|
||||||
- app-network
|
|
||||||
|
|
||||||
etherpad:
|
|
||||||
image: etherpad/etherpad:1.9.7
|
|
||||||
ports:
|
|
||||||
- "9001:9001"
|
|
||||||
volumes:
|
|
||||||
- ../doodlestudent/api/APIKEY.txt:/opt/etherpad-lite/APIKEY.txt
|
|
||||||
networks:
|
|
||||||
- app-network
|
|
||||||
healthcheck:
|
|
||||||
test: ["CMD-SHELL", "node -e \"require('http').get('http://127.0.0.1:9001', res => { process.exit(res.statusCode===200?0:1) }).on('error', ()=>process.exit(1))\""]
|
|
||||||
interval: 30s
|
|
||||||
timeout: 10s
|
|
||||||
start_period: 15s
|
|
||||||
retries: 5
|
|
||||||
|
|
||||||
mail:
|
|
||||||
image: bytemark/smtp
|
|
||||||
restart: always
|
|
||||||
ports:
|
|
||||||
- "2525:25"
|
|
||||||
networks:
|
|
||||||
- app-network
|
|
||||||
|
|
||||||
networks: # Declare the network to be used by the services
|
|
||||||
app-network: # Is a user-defined network
|
|
||||||
#external: false # If true, Docker Compose will look for an existing network with the same name and use it. If false or not specified, Docker Compose will create a new network.
|
|
||||||
name: app-network #Name of the network (optional, Docker Compose will generate one if not provided)
|
|
||||||
Reference in New Issue
Block a user