Skip to content

Commit

Permalink
chore: fix auto versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
jcmelati committed Jan 15, 2025
1 parent 6d51bdf commit 9b660eb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
9 changes: 4 additions & 5 deletions .docker/admin-server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@ RUN microdnf install curl

WORKDIR /app

# Create logs directory and set permissions
RUN mkdir -p /app/logs && \
chown -R 1002:0 /app/logs /app && \
chmod -R 775 /app/logs && \
chmod -R 755 /app
# Create temporary logs directory
RUN mkdir -p /tmp/logs && \
chown -R 1002:0 /tmp/logs && \
chmod -R 775 /tmp/logs

COPY --from=builder /app/modules/admin-server/build/libs/admin-server-*.jar ./admin-server.jar
HEALTHCHECK --interval=30s --timeout=3s CMD curl -f http://localhost:8080/status || exit 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ import java.time.format.DateTimeFormatter
class Application(private val logService: LogService) {
@PostConstruct
fun configureLogger() {
val logDir = File("/app/logs").apply { mkdirs() }
val primaryLogDir = File("/app/logs")
val fallbackLogDir = File("/tmp/logs")
val logDir = if (primaryLogDir.exists() && primaryLogDir.canWrite()) primaryLogDir else fallbackLogDir
logDir.mkdirs()

val logFile =
File(logDir, "federation-${LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))}.log")

Expand Down

0 comments on commit 9b660eb

Please sign in to comment.