# Use an official base image FROM ubuntu:latest # Set environment variables ENV DEBIAN_FRONTEND=noninteractive # Install utilities RUN apt-get update && \ apt-get install -y wget software-properties-common # Install Java 11 RUN wget -O- https://apt.corretto.aws/corretto.key | apt-key add - && \ add-apt-repository 'deb https://apt.corretto.aws stable main' && \ apt-get update && \ apt-get install -y java-11-amazon-corretto-jdk # Install MySQL 8 RUN apt-get install -y mysql-server && \ usermod -d /var/lib/mysql/ mysql # Copy init db file for order service from the workspace to the docker container COPY ./databases/order-service-db-qa.sql /docker-entrypoint-initdb.d/ COPY ./databases/order-service-db-stage.sql /docker-entrypoint-initdb.d/ # Initialize MySQL RUN service mysql start && \ mysql -u root < /docker-entrypoint-initdb.d/order-service-db-qa.sql && \ mysql -u root < /docker-entrypoint-initdb.d/order-service-db-stage.sql COPY ./databases/mysql.cnf /etc/mysql/my.cnf # Copy your JAR file into the image COPY ./qeats-order-service/ /app/ # Set working directory WORKDIR /app # Run your JAR file CMD service mysql start && chmod +x gradlew && ./gradlew bootRun