Refactor Docker setup and update file storage paths for improved containerization
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
#FROM openjdk:24 AS BUILD_IMAGE
|
||||
|
||||
#WORKDIR /jambotron/
|
||||
#COPY . ./
|
||||
#RUN microdnf install findutils
|
||||
#RUN ./gradlew build -x test
|
||||
|
||||
FROM openjdk:24
|
||||
WORKDIR /jambotron/
|
||||
VOLUME /jambotron_data/uploads
|
||||
COPY './build/libs/jambotron-0.0.1-SNAPSHOT.jar' '/app/jambotron.jar'
|
||||
#COPY --from=BUILD_IMAGE /jambotron/build/libs/jambotron-0.0.1-SNAPSHOT.jar .
|
||||
#EXPOSE 8080
|
||||
CMD ["java","-jar","/app/jambotron.jar"]
|
||||
#CMD ["java","-jar","jambotron-0.0.1-SNAPSHOT.jar"]
|
||||
@@ -0,0 +1 @@
|
||||
postgrespw
|
||||
@@ -0,0 +1,69 @@
|
||||
services:
|
||||
jambotron:
|
||||
image: 'jambotron-image'
|
||||
container_name: 'jambotron-container'
|
||||
build:
|
||||
context: ../../
|
||||
dockerfile: /Dockerfile
|
||||
ports:
|
||||
# - "8081:80"
|
||||
- "8443:443"
|
||||
depends_on:
|
||||
- postgres_jambotron
|
||||
volumes:
|
||||
- certs:/certs
|
||||
- jambotron_data:/jambotron_data
|
||||
# env_file: "webapp.env"
|
||||
environment:
|
||||
SSL_ENABLED: "true"
|
||||
SERVER_PORT: 443
|
||||
FULLCHAINPEM: /certs/live/jambotron.run.place/fullchain.pem
|
||||
PRIVKEYPEM: /certs/live/jambotron.run.place/privkey.pem
|
||||
|
||||
SPRING_DATASOURCE_URL: jdbc:postgresql://postgres_jambotron:5432/jambotronDB
|
||||
SPRING_DATASOURCE_USERNAME: admin
|
||||
SPRING_DATASOURCE_PASSWORD: postgrespw
|
||||
SPRING_FLYWAY_BASELINE-ON-MIGRATE: "true"
|
||||
SPRING_FLYWAY_VALIDATE-ON-MIGRATE: "true"
|
||||
|
||||
SPRING_FLYWAY_USER: admin
|
||||
SPRING_FLYWAY_PASSWORD: postgrespw
|
||||
SPRING_FLYWAY_URL: jdbc:postgresql://postgres_jambotron:5432/jambotronDB
|
||||
|
||||
# SPRING_DATASOURCE_URL: jdbc:postgresql://ep-red-breeze-a2cxhq5f.eu-central-1.pg.koyeb.app:5432/jambotronDB
|
||||
# SPRING_DATASOURCE_USERNAME: koyeb-adm
|
||||
# SPRING_DATASOURCE_PASSWORD: npg_HfFEUA7bay1i
|
||||
# SPRING_FLYWAY_BASELINE-ON-MIGRATE: "true"
|
||||
# SPRING_FLYWAY_VALIDATE-ON-MIGRATE: "true"
|
||||
#
|
||||
# SPRING_FLYWAY_USER: koyeb-adm
|
||||
# SPRING_FLYWAY_PASSWORD: npg_HfFEUA7bay1i
|
||||
# SPRING_FLYWAY_URL: jdbc:postgresql://ep-red-breeze-a2cxhq5f.eu-central-1.pg.koyeb.app:5432/jambotronDB
|
||||
|
||||
|
||||
# SPRING_DATASOURCE_PASSWORD: /run/secrets/db_password
|
||||
# secrets:
|
||||
# - db_password
|
||||
|
||||
|
||||
postgres_jambotron:
|
||||
image: 'postgres'
|
||||
container_name: 'jambotron-postgres-container'
|
||||
ports:
|
||||
- "5432:5432"
|
||||
environment:
|
||||
POSTGRES_USER: admin
|
||||
POSTGRES_PASSWORD: postgrespw
|
||||
# POSTGRES_PASSWORD: /run/secrets/db_password
|
||||
POSTGRES_DB: jambotronDB
|
||||
# secrets:
|
||||
# - db_password
|
||||
#
|
||||
#secrets:
|
||||
# db_password:
|
||||
# file: db_password.txt
|
||||
volumes:
|
||||
certs:
|
||||
external: true
|
||||
jambotron_data:
|
||||
# external: true
|
||||
@@ -0,0 +1,5 @@
|
||||
// investigate docker-compose.yml files for details on how to run the application
|
||||
@echo off
|
||||
//docker compose -f docker-compose.yml down
|
||||
//docker compose -f docker-compose.yml build
|
||||
//docker compose -f docker-compose.yml up -d
|
||||
@@ -0,0 +1,9 @@
|
||||
#additional investigation needed to run this script
|
||||
##!/bin/bash
|
||||
#
|
||||
## stop any previously running containers
|
||||
#docker compose --env-file .env -f DevOps/docker-compose.yml down
|
||||
## build the images
|
||||
#docker compose --env-file .env -f DevOps/docker-compose.yml build
|
||||
## start the containers
|
||||
#docker compose --env-file .env -f DevOps/docker-compose.yml up -d
|
||||
@@ -0,0 +1,3 @@
|
||||
SERVER_PORT=443
|
||||
FULLCHAINPEM=/certs/live/jambotron.run.place/fullchain.pem
|
||||
PRIVKEYPEM=/certs/live/jambotron.run.place/privkey.pem
|
||||
Reference in New Issue
Block a user