-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerFile
More file actions
26 lines (21 loc) · 1.22 KB
/
Copy pathDockerFile
File metadata and controls
26 lines (21 loc) · 1.22 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
# 1. Start with a compatible Java environment. GlassFish 4.1 works well with Java 8.
FROM openjdk:8-jdk
# 2. Set environment variables for GlassFish location and disable the first-run setup.
ENV GLASSFISH_HOME /usr/local/glassfish4
ENV PATH $PATH:$GLASSFISH_HOME/bin
# 3. Download and install GlassFish 4.1
# We use 'curl' to download, 'unzip' to extract, and then clean up the downloaded file.
RUN apt-get update && apt-get install -y curl unzip && \
curl -L -o /tmp/glassfish-4.1.zip https://download.oracle.com/glassfish/4.1/release/glassfish-4.1.zip && \
unzip /tmp/glassfish-4.1.zip -d /usr/local && \
rm /tmp/glassfish-4.1.zip && \
apt-get purge -y --auto-remove curl unzip && \
rm -rf /var/lib/apt/lists/*
# 4. Copy your .war file to the autodeploy directory of the default domain (domain1).
# IMPORTANT: You MUST change 'dist/my-web-app.war' to the actual path and name of your .war file.
COPY dist/LibraryManagementSystem.war $GLASSFISH_HOME/glassfish/domains/domain1/autodeploy/
# 5. Expose the default HTTP port (8080) and the Admin Console port (4848).
EXPOSE 8080
EXPOSE 4848
# 6. Set the default command to start the GlassFish server in the foreground.
CMD ["asadmin", "start-domain", "--verbose", "domain1"]