-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathDockerfile
More file actions
60 lines (46 loc) · 1.8 KB
/
Dockerfile
File metadata and controls
60 lines (46 loc) · 1.8 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
50
51
52
53
54
55
56
57
58
59
60
FROM cgr.dev/atlan.com/app-framework-golden:3.13
# Dapr version arguments
ARG DAPR_CLI_VERSION=1.17.0
ARG DAPR_RUNTIME_PACKAGE=dapr-daprd-1.17
# Switch to root for installation
USER root
# Install Dapr CLI (latest version for apps to use)
RUN curl -fsSL https://raw.githubusercontent.com/dapr/cli/master/install/install.sh | DAPR_INSTALL_DIR="/usr/local/bin" /bin/bash -s ${DAPR_CLI_VERSION}
# Install Dapr runtime from Chainguard APK
RUN apk add --no-cache ${DAPR_RUNTIME_PACKAGE}
# Create appuser (standardized user for all apps)
RUN addgroup -g 1000 appuser && adduser -D -u 1000 -G appuser appuser
# Set up directories for apps
RUN mkdir -p /app /home/appuser/.local/bin && \
chown -R appuser:appuser /app /home/appuser
# Remove curl and bash (no longer needed) and clean apk cache
RUN apk del curl bash && rm -rf /var/cache/apk/*
# Switch to appuser before venv creation
USER appuser
# Default working directory for applications
WORKDIR /app
# Ensure Dapr directories exist for components/runtime
RUN mkdir -p /home/appuser/.dapr/components /home/appuser/.dapr/bin && \
ln -s /usr/bin/daprd /home/appuser/.dapr/bin/daprd && \
cat <<'EOF' > /home/appuser/.dapr/config.yaml
apiVersion: dapr.io/v1alpha1
kind: Configuration
metadata:
name: daprConfig
spec: {}
EOF
# Common environment variables for all apps
ENV UV_NO_CACHE=1 \
ATLAN_DAPR_HTTP_PORT=3500 \
ATLAN_DAPR_GRPC_PORT=50001 \
ATLAN_DAPR_METRICS_PORT=3100 \
DAPR_LOG_LEVEL=info \
DAPR_APP_ID=app \
DAPR_MAX_BODY_SIZE="1024Mi" \
DO_NOT_TRACK=true \
SCARF_NO_ANALYTICS=true \
DAFT_ANALYTICS_ENABLED=0
# Copy entrypoint script for graceful shutdown handling
COPY --chown=appuser:appuser entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
ENTRYPOINT ["sh", "/usr/local/bin/entrypoint.sh"]