@@ -7,6 +7,7 @@
|
||||
|
||||
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
|
||||
@@ -4,7 +4,7 @@ services:
|
||||
container_name: 'jambotron-container'
|
||||
build:
|
||||
context: ../../
|
||||
dockerfile: ./src/Docker/Dockerfile
|
||||
dockerfile: /Dockerfile
|
||||
ports:
|
||||
# - "8081:80"
|
||||
- "8443:443"
|
||||
@@ -12,6 +12,7 @@ services:
|
||||
- postgres_jambotron
|
||||
volumes:
|
||||
- certs:/certs
|
||||
- jambotron_data:/jambotron_data
|
||||
# env_file: "webapp.env"
|
||||
environment:
|
||||
SSL_ENABLED: "true"
|
||||
@@ -63,4 +64,6 @@ services:
|
||||
# file: db_password.txt
|
||||
volumes:
|
||||
certs:
|
||||
external: true
|
||||
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
|
||||
@@ -23,6 +23,7 @@ public class JambotronApplication implements CommandLineRunner {
|
||||
logger.error("Application Run. This is an error message.");
|
||||
logger.debug("Application Run. This is a debug message.");
|
||||
logger.info("Application Run. This is an info message.");
|
||||
logger.info("Application Run. This is an info message.!!!!!!");
|
||||
}
|
||||
@Override
|
||||
public void run(String... arg) throws Exception {
|
||||
|
||||
@@ -178,17 +178,19 @@ public class TutorialController {
|
||||
try {
|
||||
|
||||
String imageFileName = FilesStorageServiceImpl.getFileNameFromUrl(tutorial.getTitleimage());
|
||||
|
||||
String servImageFileName = FilesStorageServiceImpl.getFileNameFromUrl(servTutorial.getTitleimage());
|
||||
filesStorageService.deletePublicFile(servImageFileName);
|
||||
|
||||
if(!servImageFileName.equals(imageFileName)){
|
||||
filesStorageService.deletePublicFile(servImageFileName);
|
||||
|
||||
Path path= filesStorageService.moveFile(
|
||||
user.getId().toString(),
|
||||
tutorial.getTitleimage(),
|
||||
String.format("Tutorial_%s",imageFileName )
|
||||
);
|
||||
Path path= filesStorageService.moveFile(
|
||||
user.getId().toString(),
|
||||
tutorial.getTitleimage(),
|
||||
String.format("Tutorial_%s",imageFileName )
|
||||
);
|
||||
|
||||
servTutorial.setTitleimage(FilesRoutingHelper.getPublicImageUrl(path.getFileName().toString()));
|
||||
servTutorial.setTitleimage(FilesRoutingHelper.getPublicImageUrl(path.getFileName().toString()));
|
||||
}
|
||||
|
||||
servTutorial = tutorialRepository.save(servTutorial);
|
||||
} catch (Exception e) {
|
||||
|
||||
@@ -19,9 +19,14 @@ import java.util.stream.Stream;
|
||||
@Service
|
||||
public class FilesStorageServiceImpl implements FilesStorageService {
|
||||
|
||||
private final Path root = Paths.get("uploads/user-images/");
|
||||
// private final Path root = Paths.get("uploads/user-images/");
|
||||
//
|
||||
// private final Path rootPublic = Paths.get("uploads/public-images/");
|
||||
|
||||
// Update paths to use the Docker volume
|
||||
private final Path root = Paths.get("/jambotron_data/uploads/user-images/");
|
||||
private final Path rootPublic = Paths.get("/jambotron_data/uploads/public-images/");
|
||||
|
||||
private final Path rootPublic = Paths.get("uploads/public-images/");
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
|
||||
Reference in New Issue
Block a user