-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
49 lines (37 loc) · 1.6 KB
/
Dockerfile
File metadata and controls
49 lines (37 loc) · 1.6 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
47
48
49
# =============================================================================
# DecodingUs Application Dockerfile
# =============================================================================
# Build: sbt stage && docker build -t decodingus .
# Run: docker run -p 9000:9000 --env-file .env decodingus
# =============================================================================
FROM eclipse-temurin:21-jre-jammy
# Labels for container metadata
LABEL org.opencontainers.image.title="DecodingUs"
LABEL org.opencontainers.image.description="Collaborative platform for genetic genealogy and population research"
LABEL org.opencontainers.image.source="https://github.com/decodingus/decodingus"
# Install curl for healthchecks
RUN apt-get update && apt-get install -y --no-install-recommends curl \
&& rm -rf /var/lib/apt/lists/*
# Create non-root user for security
RUN groupadd -r decodingus && useradd -r -g decodingus decodingus
# Set working directory
WORKDIR /app
# Copy the pre-built application
COPY --chown=decodingus:decodingus target/universal/stage /app
# Make scripts executable
RUN chmod +x /app/bin/decodingus
# Switch to non-root user
USER decodingus
# Expose the port the app runs on
EXPOSE 9000
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
CMD curl -f http://localhost:9000/health || exit 1
# JVM tuning for container environments
ENV JAVA_OPTS="-XX:+UseContainerSupport \
-XX:MaxRAMPercentage=75.0 \
-XX:+UseG1GC \
-XX:+ExitOnOutOfMemoryError \
-Djava.security.egd=file:/dev/./urandom"
# Command to run the application
CMD ["bin/decodingus"]