-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconsole-app-docker.yml
More file actions
60 lines (53 loc) · 2.54 KB
/
console-app-docker.yml
File metadata and controls
60 lines (53 loc) · 2.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# ---------------------------------
# _____ __ __ ______ _
# / ___// /_ ___ / /________ ____ / ____/__ ______________ ______(_)
# \__ \/ __ \/ _ \/ / ___/ __ \/ __ \ / /_ / _ \/ ___/ ___/ __ `/ ___/ /
# ___/ / / / / __/ (__ ) /_/ / / / / / __/ / __/ / / / / /_/ / / / /
# /____/_/ /_/\___/_/____/\____/_/ /_/ /_/ \___/_/ /_/ \__,_/_/ /_/
# ---------------------------------
# Currency Conversion API - Dockerfile console-app
# ---------------------------------
# This Dockerfile sets up a Docker environment to run a Java console application,
# allowing the testing of the Currency Conversion API application.
#
# Dockerfile Features:
# - Uses the OpenJDK 17 slim base image.
# - Installs Maven and other necessary dependencies.
# - Sets the working directory inside the container.
# - Dynamically creates the pom.xml file.
# - Copies the source code files to the container.
# - Downloads Maven dependencies.
# - Compiles the project using Maven.
# - Sets the default command to start the application.
# ---------------------------------
# ---------------------------------
# Use the OpenJDK 17 slim base image
# ---------------------------------
FROM openjdk:17-slim
# ---------------------------------
# Install Maven and other necessary dependencies
# ---------------------------------
RUN apt-get update && apt-get install -y maven libx11-dev socat
# ---------------------------------
# Set the working directory inside the container
# ---------------------------------
WORKDIR /app
# ---------------------------------
# Copy the project.properties, .env, and callJavaFromConsoleDocker.sh files into the container
# ---------------------------------
COPY project.properties /app/project.properties
COPY .env /app/.env
COPY sys/callJavaFromConsoleDocker.sh /app/sys/callJavaFromConsoleDocker.sh
# ---------------------------------
# Make the callJavaFromConsoleDocker.sh script executable
# ---------------------------------
RUN chmod +x /app/sys/callJavaFromConsoleDocker.sh
# ---------------------------------
# Copy specific project files
# ---------------------------------
COPY src/main/java/com/shelson/console/CurrencyConverterConsoleApp.java ./src/main/java/com/shelson/console/CurrencyConverterConsoleApp.java
COPY src/main/java/com/shelson/domain/model/Currency.java ./src/main/java/com/shelson/domain/model/Currency.java
# ---------------------------------
# Set the default command to start the application
# ---------------------------------
CMD ["/app/sys/callJavaFromConsoleDocker.sh"]