Created
May 21, 2018 17:37
-
-
Save schuchard/240f3d74ddb73a3bb74d9201bae49cef to your computer and use it in GitHub Desktop.
docker-java-springboot-maven - attempt at running maven and java springboot in docker container.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pull base image. | |
FROM java:8 | |
# update packages and install maven | |
RUN \ | |
export DEBIAN_FRONTEND=noninteractive && \ | |
sed -i 's/# \(.*multiverse$\)/\1/g' /etc/apt/sources.list && \ | |
apt-get update && \ | |
apt-get -y upgrade && \ | |
apt-get install -y vim wget curl maven | |
# attach volumes | |
VOLUME /vol/development | |
# create working directory | |
RUN mkdir -p /vol/development | |
WORKDIR /vol/development | |
COPY . /vol/development | |
# maven exec | |
CMD ["mvn", "clean", "package", "spring-boot:run"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '2.2' | |
services: | |
pgi: | |
build: | |
context: ./ | |
dockerfile: springboot.dockerfile | |
image: pgi | |
ports: | |
- 8080:8080 | |
networks: | |
- network1 | |
networks: | |
network1: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment