Image error solve update
This commit is contained in:
@ -13,6 +13,9 @@ services:
|
|||||||
MYSQL_USER: support_portal_user
|
MYSQL_USER: support_portal_user
|
||||||
MYSQL_PASSWORD: support_portal_password
|
MYSQL_PASSWORD: support_portal_password
|
||||||
MYSQL_DATABASE: support-portal
|
MYSQL_DATABASE: support-portal
|
||||||
|
volumes:
|
||||||
|
# Persist uploaded files
|
||||||
|
- blog-uploads:/app/uploads
|
||||||
networks:
|
networks:
|
||||||
- angular-spring
|
- angular-spring
|
||||||
- spring-mysql
|
- spring-mysql
|
||||||
@ -26,7 +29,7 @@ services:
|
|||||||
MYSQL_USER: support_portal_user
|
MYSQL_USER: support_portal_user
|
||||||
MYSQL_PASSWORD: support_portal_password
|
MYSQL_PASSWORD: support_portal_password
|
||||||
MYSQL_DATABASE: support-portal
|
MYSQL_DATABASE: support-portal
|
||||||
MYSQL_ROOT_PASSWORD: root_password # required for MySQL root access
|
MYSQL_ROOT_PASSWORD: root_password
|
||||||
restart: always
|
restart: always
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "mysqladmin", "ping", "-h", "127.0.0.1", "--silent"]
|
test: ["CMD", "mysqladmin", "ping", "-h", "127.0.0.1", "--silent"]
|
||||||
@ -52,7 +55,8 @@ services:
|
|||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
db-data: {}
|
db-data: {}
|
||||||
|
blog-uploads: {} # Add volume for blog uploads
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
angular-spring: {}
|
angular-spring: {}
|
||||||
spring-mysql: {}
|
spring-mysql: {}
|
||||||
@ -25,15 +25,22 @@ RUN ls -la target/
|
|||||||
# =======================
|
# =======================
|
||||||
FROM eclipse-temurin:17-jre-focal
|
FROM eclipse-temurin:17-jre-focal
|
||||||
|
|
||||||
# Expose port and set volume
|
# Expose port
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
VOLUME /tmp
|
|
||||||
|
|
||||||
# Create app directory
|
# Create app and uploads directories
|
||||||
RUN mkdir -p /app
|
RUN mkdir -p /app && \
|
||||||
|
mkdir -p /app/uploads && \
|
||||||
|
chmod 755 /app/uploads
|
||||||
|
|
||||||
# Copy the JAR from builder stage into /app directory
|
# Set working directory
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Copy the JAR from builder stage
|
||||||
COPY --from=builder /workdir/server/target/*.jar /app/
|
COPY --from=builder /workdir/server/target/*.jar /app/
|
||||||
|
|
||||||
|
# Create volume for uploads (optional but recommended)
|
||||||
|
VOLUME ["/app/uploads"]
|
||||||
|
|
||||||
# Entry point: dynamically run the first JAR in /app
|
# Entry point: dynamically run the first JAR in /app
|
||||||
ENTRYPOINT ["sh", "-c", "java -jar /app/$(ls /app | grep .jar | head -n1)"]
|
ENTRYPOINT ["sh", "-c", "java -jar /app/$(ls /app | grep .jar | head -n1)"]
|
||||||
@ -46,7 +46,7 @@ spring:
|
|||||||
# File upload configuration
|
# File upload configuration
|
||||||
file:
|
file:
|
||||||
upload:
|
upload:
|
||||||
directory: uploads
|
directory: /app/uploads
|
||||||
|
|
||||||
app:
|
app:
|
||||||
base-url: ${APP_BASE_URL:http://localhost:8080}
|
base-url: ${APP_BASE_URL:http://localhost:8080}
|
||||||
@ -69,7 +69,7 @@ file:
|
|||||||
app:
|
app:
|
||||||
base-url: https://cmcbackend.rootxwire.com
|
base-url: https://cmcbackend.rootxwire.com
|
||||||
cors:
|
cors:
|
||||||
allowed-origins: https://maincmc.rootxwire.com,https://cmcbackend.rootxwire.com, https://cmcadminfrontend.rootxwire.com
|
allowed-origins: https://maincmc.rootxwire.com,https://cmcbackend.rootxwire.com, https://cmcadminfrontend.rootxwire.com/
|
||||||
|
|
||||||
---
|
---
|
||||||
# Development file upload configuration with custom directory
|
# Development file upload configuration with custom directory
|
||||||
|
|||||||
Reference in New Issue
Block a user