1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2024-11-21 18:06:36 +02:00

update optaweb-employee-rostering

This commit is contained in:
kev 2021-11-17 19:12:33 +08:00
parent 99f1cb0856
commit f8d383c1de
2 changed files with 29 additions and 38 deletions

View File

@ -1,32 +1,23 @@
FROM maven:3-jdk-8-slim AS builder
MAINTAINER EasyPi Software Foundation
ENV APP_VERSION=8.12.0.Final
ENV APP_URL=https://github.com/kiegroup/optaweb-employee-rostering/archive/${APP_VERSION}.tar.gz
WORKDIR /opt/app
RUN set -xe \
&& curl -sSL ${APP_URL} | tar xz --strip 1 \
&& mvn clean install -DskipTests -DskipITs
#
# Dockerfile for optaweb-employee-rostering
#
FROM openjdk:8-alpine
FROM openjdk:11-jdk-slim
MAINTAINER EasyPi Software Foundation
ENV APP_VERSION=8.12.0.Final
ENV APP_VERSION=8.13.0.Final
ENV APP_FILE=optaweb-employee-rostering-distribution-${APP_VERSION}.zip
ENV APP_URL=https://download.jboss.org/optaplanner/release/${APP_VERSION}/${APP_FILE}
RUN set -xe \
&& apt update -y \
&& apt install -y wget unzip \
&& cd /opt \
&& wget ${APP_URL} \
&& unzip ${APP_FILE} \
&& mv ${APP_FILE%.zip} app \
&& rm -rf ${APP_FILE} /var/lib/apt/lists/*
WORKDIR /opt/app
COPY --from=builder /opt/app/employee-rostering-distribution/target/employee-rostering-distribution-${APP_VERSION}.jar .
EXPOSE 8080
CMD java -jar employee-rostering-distribution-${APP_VERSION}.jar \
--spring.datasource.url=jdbc:postgresql://${POSTGRES_HOST:-postgres}:${POSTGRES_PORT:-5432}/${POSTGRES_DB:-optaweb} \
--spring.datasource.username=${POSTGRES_USER:-optaweb} \
--spring.datasource.password=${POSTGRES_PASSWORD:-optaweb} \
--server.port=8080
CMD /opt/app/bin/runLocally.sh

View File

@ -6,20 +6,20 @@ services:
image: vimagick/optaweb-employee-rostering
ports:
- "8080:8080"
environment:
- POSTGRES_DB=optaweb
- POSTGRES_USER=optaweb
- POSTGRES_PASSWORD=optaweb
depends_on:
- postgres
# environment:
# - POSTGRES_DB=optaweb
# - POSTGRES_USER=optaweb
# - POSTGRES_PASSWORD=optaweb
# depends_on:
# - postgres
restart: unless-stopped
postgres:
image: postgres:14-alpine
volumes:
- ./data:/var/lib/postgresql/data
environment:
- POSTGRES_DB=optaweb
- POSTGRES_USER=optaweb
- POSTGRES_PASSWORD=optaweb
restart: unless-stopped
# postgres:
# image: postgres:14-alpine
# volumes:
# - ./data:/var/lib/postgresql/data
# environment:
# - POSTGRES_DB=optaweb
# - POSTGRES_USER=optaweb
# - POSTGRES_PASSWORD=optaweb
# restart: unless-stopped