-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
46 lines (34 loc) · 1.2 KB
/
Dockerfile
File metadata and controls
46 lines (34 loc) · 1.2 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
40
41
42
43
44
45
46
FROM --platform=linux/amd64 ruby:3.4.7-slim
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
libcurl4-openssl-dev \
libsqlite3-dev \
procps \
&& rm -rf /var/lib/apt/lists/*
# Copy Gemfile and Gemfile.lock
COPY Gemfile Gemfile.lock ./
# Install Ruby dependencies
RUN bundle install --without development test
# Copy application code
COPY . .
# Copy and set entrypoint script
COPY docker-entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
# Create non-root user and set ownership
RUN groupadd -r scopes && useradd -r -g scopes scopes && \
chown -R scopes:scopes /app && \
mkdir -p /app/db /app/tmp && \
chown -R scopes:scopes /app/db /app/tmp
# Switch to non-root user
USER scopes
# Set entrypoint
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
# Expose API port
EXPOSE 4567
# Health check - verify process is running without triggering auth logs
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD pgrep -f "bin/scopes_extractor" > /dev/null || exit 1
# Default command (can be overridden)
CMD ["bundle", "exec", "bin/scopes_extractor", "help"]