Mini fixes
This commit is contained in:
1 parent
c578b91c2d
commit
fd2e7f6cd8
2 files changed
+7
-4
No files matched your search
+5
-1
@@ -38,6 +38,7 @@ WORKDIR /app
|
|||||||
|
|
||||||
# Copy the binary from the builder stage
|
# Copy the binary from the builder stage
|
||||||
COPY --from=builder /app/server /app/server
|
COPY --from=builder /app/server /app/server
|
||||||
|
RUN chmod +x /app/server
|
||||||
|
|
||||||
# Copy static and template assets from the project source
|
# Copy static and template assets from the project source
|
||||||
COPY --from=builder /build/static /app/static
|
COPY --from=builder /build/static /app/static
|
||||||
@@ -46,10 +47,13 @@ COPY --from=builder /build/templates /app/templates
|
|||||||
# Ensure the app user owns the working dir (DB file created here at runtime)
|
# Ensure the app user owns the working dir (DB file created here at runtime)
|
||||||
RUN chown -R app:app /app
|
RUN chown -R app:app /app
|
||||||
|
|
||||||
|
# Create a dedicated subdirectory for persistable data (mounted as a volume)
|
||||||
|
RUN mkdir -p /app/data
|
||||||
|
|
||||||
USER app
|
USER app
|
||||||
|
|
||||||
# Expose the HTTP port
|
# Expose the HTTP port
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
|
|
||||||
# Default command
|
# Default command
|
||||||
CMD ["./server", "-addr", ":8080"]
|
CMD ["/app/server", "-addr", ":8080", "-db", "/app/data/state.db"]
|
||||||
+2
-3
@@ -5,12 +5,11 @@ services:
|
|||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
container_name: uportal
|
|
||||||
ports:
|
ports:
|
||||||
- "8080:8080"
|
- "8080:8080"
|
||||||
volumes:
|
volumes:
|
||||||
# Bind mount to persist the SQLite database file locally in ./data/
|
# Bind mount only the data subdirectory, so /app/server and assets are NOT overwritten
|
||||||
- ./data:/app
|
- ./data:/app/data
|
||||||
environment:
|
environment:
|
||||||
LOG_LEVEL: info
|
LOG_LEVEL: info
|
||||||
# Optional configuration (uncomment as needed):
|
# Optional configuration (uncomment as needed):
|
||||||
|
|||||||
Reference in new issue
Block a user