feat: finalize jakarta-jsp devcontainer setup
This commit is contained in:
parent
acf4e95e08
commit
3a32b39f3d
7 changed files with 7 additions and 115 deletions
|
|
@ -7,6 +7,6 @@ RUN mkdir -p /config/lib && \
|
||||||
|
|
||||||
RUN features.sh
|
RUN features.sh
|
||||||
|
|
||||||
COPY --chown=1001:0 target/*.war /config/apps
|
#COPY --chown=1001:0 target/*.war /config/apps
|
||||||
|
|
||||||
RUN configure.sh
|
RUN configure.sh
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ services:
|
||||||
dockerfile: .devcontainer/Dockerfile.dev
|
dockerfile: .devcontainer/Dockerfile.dev
|
||||||
volumes:
|
volumes:
|
||||||
- ../..:/workspaces:cached
|
- ../..:/workspaces:cached
|
||||||
|
- ./app:/app
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_HOST: postgresdb
|
POSTGRES_HOST: postgresdb
|
||||||
POSTGRES_PORT: 5432
|
POSTGRES_PORT: 5432
|
||||||
|
|
@ -30,6 +31,8 @@ services:
|
||||||
POSTGRES_DB: todo_db
|
POSTGRES_DB: todo_db
|
||||||
POSTGRES_USER: postgres
|
POSTGRES_USER: postgres
|
||||||
POSTGRES_PASSWORD: postgres
|
POSTGRES_PASSWORD: postgres
|
||||||
|
volumes:
|
||||||
|
- ./app:/config/dropins
|
||||||
depends_on:
|
depends_on:
|
||||||
- db
|
- db
|
||||||
networks:
|
networks:
|
||||||
|
|
@ -41,6 +44,7 @@ services:
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
volumes:
|
volumes:
|
||||||
- postgres-data:/var/lib/postgresql/data
|
- postgres-data:/var/lib/postgresql/data
|
||||||
|
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_PASSWORD: postgres
|
POSTGRES_PASSWORD: postgres
|
||||||
POSTGRES_USER: postgres
|
POSTGRES_USER: postgres
|
||||||
|
|
|
||||||
|
|
@ -1,62 +0,0 @@
|
||||||
# # Dockerfile für OpenLiberty
|
|
||||||
# FROM icr.io/appcafe/open-liberty:23.0.0.4-kernel-slim-java17-openj9-ubi
|
|
||||||
# COPY --chown=1001:0 /src/main/liberty/config /config
|
|
||||||
#
|
|
||||||
# # PostgreSQL JDBC-Treiber laden
|
|
||||||
# # RUN mkdir -p ./lib && \
|
|
||||||
# # curl -o ./lib/postgresql.jar https://jdbc.postgresql.org/download/postgresql-42.6.0.jar
|
|
||||||
#
|
|
||||||
# RUN curl -o /config/lib/postgresql.jar https://jdbc.postgresql.org/download/postgresql-42.6.0.jar
|
|
||||||
#
|
|
||||||
# RUN features.sh
|
|
||||||
#
|
|
||||||
# COPY --chown=1001:0 target/*.war /config/apps
|
|
||||||
#
|
|
||||||
# RUN configure.sh
|
|
||||||
#
|
|
||||||
# # # Arbeitsverzeichnis setzen
|
|
||||||
# # WORKDIR /opt/ol/wlp/usr/servers/defaultServer
|
|
||||||
# #
|
|
||||||
# # # Notwendige Dateien kopieren
|
|
||||||
# # COPY target/todo-app.war ./apps/
|
|
||||||
# # # COPY server.xml ./
|
|
||||||
# #
|
|
||||||
# # # PostgreSQL JDBC-Treiber laden
|
|
||||||
# # RUN mkdir -p ./lib && \
|
|
||||||
# # curl -o ./lib/postgresql.jar https://jdbc.postgresql.org/download/postgresql-42.6.0.jar
|
|
||||||
# #
|
|
||||||
# # # OpenLiberty starten
|
|
||||||
# # CMD ["/opt/ol/wlp/bin/server", "run", "defaultServer"]
|
|
||||||
|
|
||||||
# FROM icr.io/appcafe/open-liberty:23.0.0.4-kernel-slim-java17-openj9-ubi
|
|
||||||
#
|
|
||||||
# # COPY --chown=1001:0 /src/main/liberty/config /config
|
|
||||||
# #
|
|
||||||
# # COPY --chown=1001:0 /src/main/liberty/config/server.xml /opt/ol/wlp/usr/servers/defaultServer/
|
|
||||||
#
|
|
||||||
# RUN chmod 644 /opt/ol/wlp/usr/servers/defaultServer/server.xml
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# # Verzeichnis erstellen und PostgreSQL JDBC-Treiber herunterladen
|
|
||||||
# RUN mkdir -p /config/lib && \
|
|
||||||
# curl -o /config/lib/postgresql.jar https://jdbc.postgresql.org/download/postgresql-42.6.0.jar
|
|
||||||
#
|
|
||||||
# RUN features.sh
|
|
||||||
#
|
|
||||||
# COPY --chown=1001:0 target/*.war /config/apps
|
|
||||||
#
|
|
||||||
# RUN configure.sh
|
|
||||||
|
|
||||||
FROM icr.io/appcafe/open-liberty:23.0.0.4-kernel-slim-java17-openj9-ubi
|
|
||||||
|
|
||||||
COPY --chown=1001:0 /src/main/liberty/config /config
|
|
||||||
# # Verzeichnis erstellen und PostgreSQL JDBC-Treiber herunterladen
|
|
||||||
RUN mkdir -p /config/lib && \
|
|
||||||
curl -o /config/lib/postgresql.jar https://jdbc.postgresql.org/download/postgresql-42.6.0.jar
|
|
||||||
|
|
||||||
RUN features.sh
|
|
||||||
|
|
||||||
COPY --chown=1001:0 target/*.war /config/apps
|
|
||||||
|
|
||||||
RUN configure.sh
|
|
||||||
|
|
||||||
|
|
@ -1,50 +0,0 @@
|
||||||
version: "3.8"
|
|
||||||
|
|
||||||
services:
|
|
||||||
postgres:
|
|
||||||
image: postgres:15
|
|
||||||
networks:
|
|
||||||
- my_network
|
|
||||||
container_name: postgres_db
|
|
||||||
restart: always
|
|
||||||
environment:
|
|
||||||
POSTGRES_DB: todo_db
|
|
||||||
POSTGRES_USER: postgres
|
|
||||||
POSTGRES_PASSWORD: postgres
|
|
||||||
ports:
|
|
||||||
- "5432:5432"
|
|
||||||
volumes:
|
|
||||||
- postgres_data:/var/lib/postgresql/data
|
|
||||||
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
|
|
||||||
healthcheck:
|
|
||||||
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
|
||||||
interval: 5s
|
|
||||||
timeout: 5s
|
|
||||||
retries: 10
|
|
||||||
|
|
||||||
openliberty:
|
|
||||||
build: .
|
|
||||||
container_name: openliberty_app
|
|
||||||
networks:
|
|
||||||
- my_network
|
|
||||||
restart: always
|
|
||||||
ports:
|
|
||||||
- "9080:9080"
|
|
||||||
- "9443:9443"
|
|
||||||
depends_on:
|
|
||||||
- postgres
|
|
||||||
environment:
|
|
||||||
- POSTGRES_HOST=postgres
|
|
||||||
- POSTGRES_PORT=5432
|
|
||||||
- POSTGRES_DB=todo_db
|
|
||||||
- POSTGRES_USER=postgres
|
|
||||||
- POSTGRES_PASSWORD=postgres
|
|
||||||
volumes:
|
|
||||||
- ./src/main/liberty/config/server.xml:/config/server.xml
|
|
||||||
# - ./src/main/liberty/config/server.xml:/opt/ol/wlp/usr/servers/defaultServer/server.xml
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
postgres_data:
|
|
||||||
networks:
|
|
||||||
my_network:
|
|
||||||
driver: bridge
|
|
||||||
|
|
@ -61,7 +61,7 @@ public class HibernateUtil {
|
||||||
try {
|
try {
|
||||||
Configuration configuration = new Configuration();
|
Configuration configuration = new Configuration();
|
||||||
configuration.setProperty("hibernate.connection.driver_class", "org.postgresql.Driver");
|
configuration.setProperty("hibernate.connection.driver_class", "org.postgresql.Driver");
|
||||||
configuration.setProperty("hibernate.connection.url", "jdbc:postgresql://postgres:5432/todo_db");
|
configuration.setProperty("hibernate.connection.url", "jdbc:postgresql://postgresdb:5432/todo_db");
|
||||||
configuration.setProperty("hibernate.connection.username", "postgres");
|
configuration.setProperty("hibernate.connection.username", "postgres");
|
||||||
configuration.setProperty("hibernate.connection.password", "postgres");
|
configuration.setProperty("hibernate.connection.password", "postgres");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
<class>com.todoapp.model.Todo</class>
|
<class>com.todoapp.model.Todo</class>
|
||||||
<properties>
|
<properties>
|
||||||
<property name="jakarta.persistence.jdbc.driver" value="org.postgresql.Driver"/>
|
<property name="jakarta.persistence.jdbc.driver" value="org.postgresql.Driver"/>
|
||||||
<property name="jakarta.persistence.jdbc.url" value="jdbc:postgresql://postgres:5432/todo_db"/>
|
<property name="jakarta.persistence.jdbc.url" value="jdbc:postgresql://postgresdb:5432/todo_db"/>
|
||||||
<property name="jakarta.persistence.jdbc.user" value="postgres"/>
|
<property name="jakarta.persistence.jdbc.user" value="postgres"/>
|
||||||
<property name="jakarta.persistence.jdbc.password" value="postgres"/>
|
<property name="jakarta.persistence.jdbc.password" value="postgres"/>
|
||||||
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>
|
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue