mirror of
https://github.com/laoxong/nofx.git
synced 2026-06-04 01:48:22 +08:00
41 lines
1.1 KiB
Docker
41 lines
1.1 KiB
Docker
# Railway All-in-One: Reuse existing GHCR images
|
|
# Extract content from existing images and merge into a single container
|
|
|
|
# Extract binary from backend image
|
|
FROM ghcr.io/nofxaios/nofx/nofx-backend:latest AS backend
|
|
|
|
# Extract static files from frontend image
|
|
FROM ghcr.io/nofxaios/nofx/nofx-frontend:latest AS frontend
|
|
|
|
# Final image
|
|
FROM alpine:latest
|
|
|
|
RUN apk add --no-cache ca-certificates tzdata sqlite nginx openssl gettext
|
|
|
|
# Copy backend binary
|
|
COPY --from=backend /app/nofx /app/nofx
|
|
|
|
# Copy TA-Lib libraries
|
|
COPY --from=backend /usr/local/lib/libta_lib* /usr/local/lib/
|
|
RUN ldconfig /usr/local/lib 2>/dev/null || true
|
|
|
|
# Copy frontend static files
|
|
COPY --from=frontend /usr/share/nginx/html /usr/share/nginx/html
|
|
|
|
WORKDIR /app
|
|
RUN mkdir -p /app/data
|
|
|
|
# Startup script (includes nginx config generation)
|
|
COPY railway/start.sh /app/start.sh
|
|
RUN chmod +x /app/start.sh
|
|
|
|
ENV DB_PATH=/app/data/data.db
|
|
|
|
# Railway automatically sets the PORT environment variable
|
|
EXPOSE 8080
|
|
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
|
|
CMD wget --no-verbose --tries=1 --spider http://localhost:${PORT:-8080}/health || exit 1
|
|
|
|
CMD ["/app/start.sh"]
|