-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (27 loc) · 1.08 KB
/
Dockerfile
File metadata and controls
39 lines (27 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Build stage
FROM ruby:4.0-alpine3.23 AS builder
RUN apk add --no-cache build-base git libffi-dev yaml-dev nodejs npm
WORKDIR /app
COPY . .
# Build frontend assets
RUN cd frontend && npm ci && npm run build
# Build and install the gem
RUN gem build archsight.gemspec && \
gem install --no-document archsight-*.gem
# Runtime stage
FROM ruby:4.0-alpine3.23
# Copy installed gems from builder (including default gems that were updated)
COPY --from=builder /usr/local/bundle /usr/local/bundle
COPY --from=builder /usr/local/lib/ruby/gems /usr/local/lib/ruby/gems
# Ensure Ruby finds gems in both /usr/local/bundle and default gems location
ENV GEM_HOME=/usr/local/bundle
ENV GEM_PATH=/usr/local/bundle:/usr/local/lib/ruby/gems/4.0.0
ENV PATH="/usr/local/bundle/bin:${PATH}"
RUN mkdir -p /resources
ENV ARCHSIGHT_RESOURCES_DIR=/resources
ENV APP_ENV=production
EXPOSE 4567
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:4567/ || exit 1
ENTRYPOINT ["archsight"]
CMD ["web", "--port", "4567", "--host", "0.0.0.0"]