Add docker support (Dockerfile && docker-compose.yml)

This commit is contained in:
Serafeim Chatzopoulos 2024-03-04 15:55:03 +02:00
parent f0afdd7a7f
commit 64d48fb877
6 changed files with 34 additions and 5 deletions

3
.env
View File

@ -0,0 +1,3 @@
ZK_HOSTS=zookeeper-solr-openaire-dev-1:2181,zookeeper-solr-openaire-dev-2:2181,zookeeper-solr-openaire-dev-3:2181
SOLR_COLLECTION=TMF-index-openaire
OPENAPI_SERVER_BASE_URL=http://localhost:8080

2
.gitignore vendored
View File

@ -1,4 +1,4 @@
HELP.md
README.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/

13
Dockerfile Normal file
View File

@ -0,0 +1,13 @@
FROM openjdk:21
WORKDIR /app
VOLUME /tmp
EXPOSE 8080
ARG JAR_FILE=target/openaire-rest-api-0.0.1-SNAPSHOT.jar
ADD ${JAR_FILE} entrypoint.jar
ENTRYPOINT ["java", "-jar", "/app/entrypoint.jar"]

View File

@ -0,0 +1,13 @@
version: '3'
services:
openaire-search-api:
image: openaire-search-api-v2:latest
container_name: openaire-search-api-v2
ports:
- "8080:8080"
volumes:
- ./logs:/app/logs
environment:
- ZK_HOSTS=zookeeper-solr-openaire-dev-1:2181,zookeeper-solr-openaire-dev-2:2181,zookeeper-solr-openaire-dev-3:2181
- SOLR_COLLECTION=TMF-index-openaire
- OPENAPI_SERVER_BASE_URL=http://localhost:8080

View File

@ -1,11 +1,11 @@
openapi.server-base-url=http://localhost:8080
openapi.server-base-url=${OPENAPI_SERVER_BASE_URL}
openapi.terms-url=https://graph.openaire.eu/docs/apis/terms
openapi.license-url=https://graph.openaire.eu/docs/license
openapi.contact-url=https://graph.openaire.eu/helpdesk
openapi.description=The Search API allows developers to access metadata records of the OpenAIRE Graph by performing queries over research products (i.e., publications, data, software, other research products), and projects.
solr.collection=TMF-index-openaire
solr.zkHosts=zookeeper-solr-openaire-dev-1:2181,zookeeper-solr-openaire-dev-2:2181,zookeeper-solr-openaire-dev-3:2181
solr.collection=${SOLR_COLLECTION}
solr.zkHosts=${ZK_HOSTS}
logging.level.org.springframework.web=DEBUG

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Configuration status="trace">
<Configuration>
<Properties>
<Property name="logpath-location">logs/</Property>
<Property name="logfile-name">api.log</Property>