-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
57 lines (42 loc) · 1.4 KB
/
Dockerfile
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
# Clickhouse custom docker image for GovA11y
# Start from the latest ClickHouse image
FROM clickhouse/clickhouse-server:latest
# Copy startup initialization script
COPY startup/ /docker-entrypoint-initdb.d/
# Copy configuration files directly into /etc/clickhouse-server/
COPY config/ /etc/clickhouse-server/
# Copy & Setup Migrations
COPY migrations/ /etc/clickhouse-server/migrations/
# Ensure init.sh is executable
RUN chmod +x /docker-entrypoint-initdb.d/init.sh
# Define a volume for the data
VOLUME /var/lib/clickhouse
# Define a volume for the logs
VOLUME /var/log/clickhouse-server
# Create GovA11y
# ENV CLICKHOUSE_DB=gova11y
ENV CLICKHOUSE_USER=ChangeMe
ENV CLICKHOUSE_PASSWORD=PleaseChangeMe
ENV CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT=1
# Set default Sentry reporting
ENV SENTRY_DSN="https://[email protected]/16"
ENV SENTRY_ANONYMIZE=true
ENV SEND_CRASH_REPORTS=true
# Do some housekeeping
RUN locale-gen en_US.UTF-8
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US:en
ENV LC_ALL=en_US.UTF-8
ENV TZ=UTC
# Expose ports
EXPOSE 8123
EXPOSE 9000
EXPOSE 9005
# Health Check
# Install curl
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
# Define Health Check
HEALTHCHECK --start-period=15s --interval=10s --timeout=5s --retries=5 \
CMD curl -f http://localhost:8123/ping || exit 1
# Define the command to start ClickHouse
ENTRYPOINT ["/entrypoint.sh"]