Add Dockerfile and basic web application skeleton
This commit is contained in:
Родитель
55040176e1
Коммит
901088093f
|
@ -0,0 +1,30 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<project
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.azure.sample</groupId>
|
||||
<artifactId>wildfly-container-quickstart</artifactId>
|
||||
<version>1-SNAPSHOT</version>
|
||||
<packaging>war</packaging>
|
||||
<name>A WildFly Container Quickstart</name>
|
||||
<build>
|
||||
<finalName>wildfly-container-quickstart</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<version>3.2.3</version>
|
||||
<configuration>
|
||||
<failOnMissingWebXml>false</failOnMissingWebXml>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<properties>
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
</properties>
|
||||
</project>
|
|
@ -0,0 +1,62 @@
|
|||
#
|
||||
# Officially supported Zulu JDK
|
||||
#
|
||||
# For support or general questions go to:
|
||||
#
|
||||
# https://support.microsoft.com/en-us/help/4026305/sql-contact-microsoft-azure-support
|
||||
#
|
||||
FROM mcr.microsoft.com/java/jdk:8u242-zulu-centos
|
||||
|
||||
# Install packages necessary to run WildFly
|
||||
RUN yum update -y && yum -y install bsdtar unzip && yum clean all
|
||||
|
||||
# Create a user and group used to launch processes
|
||||
# The user ID 1000 is the default for the first "regular" user on Fedora/RHEL,
|
||||
# so there is a high chance that this ID will be equal to the current user
|
||||
# making it easier to use volumes (no permission issues)
|
||||
RUN groupadd -r jboss -g 1000 && useradd -u 1000 -r -g jboss -m -d /opt/jboss -s /sbin/nologin -c "JBoss user" jboss && \
|
||||
chmod 755 /opt/jboss
|
||||
|
||||
# Set the working directory to jboss' user home directory
|
||||
WORKDIR /opt/jboss
|
||||
|
||||
# Specify the user which should be used to execute all commands below
|
||||
USER jboss
|
||||
|
||||
# Set the WILDFLY_VERSION env variable
|
||||
ENV WILDFLY_VERSION 18.0.1.Final
|
||||
ENV WILDFLY_SHA1 ef0372589a0f08c36b15360fe7291721a7e3f7d9
|
||||
ENV JBOSS_HOME /opt/jboss/wildfly
|
||||
|
||||
# Set the root for install
|
||||
USER root
|
||||
|
||||
# Add the WildFly distribution to /opt, and make wildfly the owner of the extracted tar content
|
||||
# Make sure the distribution is available from a well-known place
|
||||
|
||||
RUN cd $HOME \
|
||||
&& curl -O https://download.jboss.org/wildfly/$WILDFLY_VERSION/wildfly-$WILDFLY_VERSION.tar.gz \
|
||||
&& sha1sum wildfly-$WILDFLY_VERSION.tar.gz | grep $WILDFLY_SHA1 \
|
||||
&& tar xf wildfly-$WILDFLY_VERSION.tar.gz \
|
||||
&& mv $HOME/wildfly-$WILDFLY_VERSION $JBOSS_HOME \
|
||||
&& rm wildfly-$WILDFLY_VERSION.tar.gz \
|
||||
&& chown -R jboss:0 ${JBOSS_HOME} \
|
||||
&& chmod -R g+rw ${JBOSS_HOME}
|
||||
|
||||
# Ensure signals are forwarded to the JVM process correctly for graceful shutdown
|
||||
ENV LAUNCH_JBOSS_IN_BACKGROUND true
|
||||
|
||||
# Set the current user for JBoss process
|
||||
USER jboss
|
||||
|
||||
# Expose the ports we're interested in
|
||||
EXPOSE 8080
|
||||
|
||||
# Set the default command to run on boot
|
||||
# This will boot WildFly in the standalone mode and bind to all interface
|
||||
CMD ["/opt/jboss/wildfly/bin/standalone.sh", "-b", "0.0.0.0"]
|
||||
|
||||
#
|
||||
# Copy the WAR file
|
||||
#
|
||||
COPY target/wildfly-container-quickstart.war /opt/jboss/wildfly/standalone/deployments/ROOT.war
|
|
@ -0,0 +1,8 @@
|
|||
<html>
|
||||
<head>
|
||||
<title>WildFly Container Quickstart</title>
|
||||
</head>
|
||||
<body>
|
||||
You have the WildFly Container Quickstart up and running!
|
||||
</body>
|
||||
</html>
|
Загрузка…
Ссылка в новой задаче