Commit cbb699e6 authored by Petter Goksøyr Åsen's avatar Petter Goksøyr Åsen
Browse files

Add separate build-container for services

parent 263adf6f
......@@ -83,6 +83,11 @@ rebuild=vagrant ssh $(SHIP) -c "cd /vagrant/docker-compose &&\
rebuild_services: ## Force rebuilds services
@echo "======= FORCE RECREATING SERVICES ======\n"
vagrant ssh $(SHIP) -c "cd /vagrant/docker-compose &&\
sudo docker-compose stop build_services || true &&\
sudo docker-compose rm -f build_services || true &&\
sudo docker-compose build build_services &&\
sudo docker-compose run build_services"
$(call rebuild,services)
rebuild_catalinker: ## Force rebuilds catalinker
......
......@@ -165,14 +165,23 @@ services:
KOHA_INTRA_PORT: "http://${HOST}:8081"
SERVICES_PORT: "http://services:8005"
build_services:
container_name: build_services
build:
context: /vagrant/redef/services
dockerfile: Dockerfile.build
volumes:
- /vagrant/redef/services/build:/services/build
services:
container_name: redef_services_container
build:
context: /vagrant/redef/services
dockerfile: Dockerfile.build
dockerfile: Dockerfile
networks:
- backend
depends_on:
- build_services
- fuseki
- koha
ports:
......@@ -189,6 +198,7 @@ services:
GITREF: "${GITREF}"
BUILD_TAG: "${BUILD_TAG}"
patron-client:
container_name: redef_patron_client_container
build:
......
......@@ -171,14 +171,23 @@ services:
GITREF: "${GITREF}"
BUILD_TAG: "${BUILD_TAG}"
build_services:
container_name: build_services
build:
context: /vagrant/redef/services
dockerfile: Dockerfile.build
volumes:
- /vagrant/redef/services/build:/services/build
services:
container_name: redef_services_container
build:
context: /vagrant/redef/services
dockerfile: Dockerfile.build
dockerfile: Dockerfile
networks:
- backend
depends_on:
- build_services
- fuseki
- koha
ports:
......
FROM java:8
ADD javarunner.sh /services/
ADD javarunner.sh /javarunner.sh
CMD /services/javarunner.sh \
ADD build/libs/services-1.0-SNAPSHOT-standalone.jar /services-1.0-SNAPSHOT-standalone.jar
CMD /javarunner.sh \
-DKOHA_PORT="$KOHA_PORT" \
-DKOHA_USER="$KOHA_USER" \
-DKOHA_PASSWORD="$KOHA_PASSWORD" \
......@@ -10,4 +12,4 @@ CMD /services/javarunner.sh \
-DELASTICSEARCH_URL="$ELASTICSEARCH_URL" \
-Done-jar.silent=true \
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5070 \
-jar /services/build/libs/services-1.0-SNAPSHOT-standalone.jar
-jar /services-1.0-SNAPSHOT-standalone.jar
FROM java:openjdk-8-jdk
#VOLUME /services/build/libs
COPY . /services
WORKDIR /services
......@@ -9,17 +7,4 @@ WORKDIR /services
# Install gradle and cache dependencies
RUN ./gradlew --no-daemon dependencies
RUN ./gradlew --no-daemon build oneJar
ADD javarunner.sh /services/
CMD /services/javarunner.sh \
-DKOHA_PORT="$KOHA_PORT" \
-DKOHA_USER="$KOHA_USER" \
-DKOHA_PASSWORD="$KOHA_PASSWORD" \
-DTRIPLESTORE_PORT="$TRIPLESTORE_PORT" \
-DDATA_BASEURI="$DATA_BASEURI" \
-DELASTICSEARCH_URL="$ELASTICSEARCH_URL" \
-Done-jar.silent=true \
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5070 \
-jar /services/build/libs/services-1.0-SNAPSHOT-standalone.jar
CMD ./gradlew --no-daemon build oneJar
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment