BAEL-219 - adding docker files
This commit is contained in:
parent
82afbe6aef
commit
f811eacebb
|
@ -0,0 +1,4 @@
|
|||
FROM alpine:edge
|
||||
MAINTAINER baeldung.com
|
||||
RUN apk add --no-cache openjdk8
|
||||
COPY files/UnlimitedJCEPolicyJDK8/* /usr/lib/jvm/java-1.8-openjdk/jre/lib/security/
|
|
@ -0,0 +1,6 @@
|
|||
FROM alpine-java:base
|
||||
MAINTAINER baeldung.com
|
||||
RUN apk --no-cache add netcat-openbsd
|
||||
COPY files/config-client.jar /opt/spring-cloud/lib/
|
||||
COPY files/config-client-entrypoint.sh /opt/spring-cloud/bin/
|
||||
RUN chmod 755 /opt/spring-cloud/bin/config-client-entrypoint.sh
|
|
@ -0,0 +1,9 @@
|
|||
FROM alpine-java:base
|
||||
MAINTAINER baeldung.com
|
||||
COPY files/config-server.jar /opt/spring-cloud/lib/
|
||||
ENV SPRING_APPLICATION_JSON='{"spring": {"cloud": {"config": {"server": \
|
||||
{"git": {"uri": "/var/lib/spring-cloud/config-repo", "clone-on-start": true}}}}}}'
|
||||
ENTRYPOINT ["/usr/bin/java"]
|
||||
CMD ["-jar", "/opt/spring-cloud/lib/config-server.jar"]
|
||||
VOLUME /var/lib/spring-cloud/config-repo
|
||||
EXPOSE 8888
|
|
@ -0,0 +1,8 @@
|
|||
#!/bin/sh
|
||||
|
||||
while ! nc -z config-server 8888 ; do
|
||||
echo "Waiting for upcoming Config Server"
|
||||
sleep 2
|
||||
done
|
||||
|
||||
java -jar /opt/spring-cloud/lib/config-client.jar
|
|
@ -0,0 +1,41 @@
|
|||
version: '2'
|
||||
services:
|
||||
config-server:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile.server
|
||||
image: config-server:latest
|
||||
expose:
|
||||
- 8888
|
||||
networks:
|
||||
- spring-cloud-network
|
||||
volumes:
|
||||
- spring-cloud-config-repo:/var/lib/spring-cloud/config-repo
|
||||
logging:
|
||||
driver: json-file
|
||||
config-client:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile.client
|
||||
image: config-client:latest
|
||||
entrypoint: /opt/spring-cloud/bin/config-client-entrypoint.sh
|
||||
environment:
|
||||
SPRING_APPLICATION_JSON: '{"spring": {"cloud": {"config": {"uri": "http://config-server:8888"}}}}'
|
||||
expose:
|
||||
- 8080
|
||||
ports:
|
||||
- 8080
|
||||
networks:
|
||||
- spring-cloud-network
|
||||
links:
|
||||
- config-server:config-server
|
||||
depends_on:
|
||||
- config-server
|
||||
logging:
|
||||
driver: json-file
|
||||
networks:
|
||||
spring-cloud-network:
|
||||
driver: bridge
|
||||
volumes:
|
||||
spring-cloud-config-repo:
|
||||
external: true
|
|
@ -0,0 +1,43 @@
|
|||
version: '2'
|
||||
services:
|
||||
config-server:
|
||||
container_name: config-server
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile.server
|
||||
image: config-server:latest
|
||||
expose:
|
||||
- 8888
|
||||
networks:
|
||||
- spring-cloud-network
|
||||
volumes:
|
||||
- spring-cloud-config-repo:/var/lib/spring-cloud/config-repo
|
||||
logging:
|
||||
driver: json-file
|
||||
config-client:
|
||||
container_name: config-client
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile.client
|
||||
image: config-client:latest
|
||||
entrypoint: /opt/spring-cloud/bin/config-client-entrypoint.sh
|
||||
environment:
|
||||
SPRING_APPLICATION_JSON: '{"spring": {"cloud": {"config": {"uri": "http://config-server:8888"}}}}'
|
||||
expose:
|
||||
- 8080
|
||||
ports:
|
||||
- 8080:8080
|
||||
networks:
|
||||
- spring-cloud-network
|
||||
links:
|
||||
- config-server:config-server
|
||||
depends_on:
|
||||
- config-server
|
||||
logging:
|
||||
driver: json-file
|
||||
networks:
|
||||
spring-cloud-network:
|
||||
driver: bridge
|
||||
volumes:
|
||||
spring-cloud-config-repo:
|
||||
external: true
|
Loading…
Reference in New Issue