admin reachable on server
This commit is contained in:
42
Dockerfile
42
Dockerfile
@@ -101,9 +101,45 @@ ENV HOSTNAME="0.0.0.0"
|
||||
|
||||
CMD ["node", "server.js"]
|
||||
|
||||
# Default production stage (for Dokku - runs API)
|
||||
FROM go-base AS production
|
||||
# Default production stage (for Dokku - runs API + Admin)
|
||||
FROM node:20-alpine AS production
|
||||
|
||||
# Install runtime dependencies
|
||||
RUN apk add --no-cache ca-certificates tzdata curl
|
||||
|
||||
# Create non-root user
|
||||
RUN addgroup -g 1000 app && adduser -u 1000 -G app -s /bin/sh -D app
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy Go binaries
|
||||
COPY --from=builder /app/api /app/api
|
||||
COPY --from=builder /app/worker /app/worker
|
||||
|
||||
# Copy templates directory
|
||||
COPY --from=builder /app/templates /app/templates
|
||||
|
||||
# Copy migrations and seeds
|
||||
COPY --from=builder /app/migrations /app/migrations
|
||||
COPY --from=builder /app/seeds /app/seeds
|
||||
|
||||
# Copy admin panel standalone build
|
||||
COPY --from=admin-builder /app/.next/standalone /app/admin
|
||||
COPY --from=admin-builder /app/.next/static /app/admin/.next/static
|
||||
COPY --from=admin-builder /app/public /app/admin/public
|
||||
|
||||
# Copy start script
|
||||
COPY start.sh /app/start.sh
|
||||
RUN chmod +x /app/start.sh
|
||||
|
||||
# Create uploads directory
|
||||
RUN mkdir -p /app/uploads && chown -R app:app /app
|
||||
|
||||
USER app
|
||||
|
||||
EXPOSE 5000
|
||||
|
||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \
|
||||
CMD curl -f http://localhost:${PORT:-5000}/api/health/ || exit 1
|
||||
CMD ["/app/api"]
|
||||
|
||||
CMD ["/app/start.sh"]
|
||||
|
||||
Reference in New Issue
Block a user