Skip to content

Instantly share code, notes, and snippets.

@schuchard
Created May 21, 2018 17:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save schuchard/240f3d74ddb73a3bb74d9201bae49cef to your computer and use it in GitHub Desktop.
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.
# 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"]
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