This repository has been archived on 2025-07-20. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
analytics/Dockerfile
AKP ab6ea72931
Add (awful) Dockerfile
Signed-off-by: AKP <tom@tdpain.net>
2023-04-05 17:36:34 +01:00

27 lines
No EOL
689 B
Docker

FROM golang:1.20 as builder
RUN mkdir /build
ADD . /build/
WORKDIR /build
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-extldflags "-static" -s -w' -o main github.com/codemicro/analytics/ingest
FROM python:3
ENV PIP_DISABLE_PIP_VERSION_CHECK=on
RUN mkdir -p /analytics/ds/
WORKDIR /analytics
COPY --from=builder /build/main ./ingest
ADD datasette_plugin ds/plugins
ADD config/datasette-metadata.json ds/metadata.json
ADD docker-entrypoint.sh .
RUN pip install --no-cache-dir datasette
RUN pip install --no-cache-dir -r ds/plugins/requirements.txt
RUN mkdir -p /analytics/run
WORKDIR /analytics/run
STOPSIGNAL SIGKILL
CMD ["bash", "../docker-entrypoint.sh"]