Add (awful) Dockerfile
Signed-off-by: AKP <tom@tdpain.net>
This commit is contained in:
parent
bda06afd9c
commit
ab6ea72931
3 changed files with 35 additions and 1 deletions
27
Dockerfile
Normal file
27
Dockerfile
Normal file
|
@ -0,0 +1,27 @@
|
|||
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"]
|
|
@ -1,2 +1,3 @@
|
|||
dominate
|
||||
pyyaml
|
||||
pyyaml
|
||||
python-baseconv
|
6
docker-entrypoint.sh
Normal file
6
docker-entrypoint.sh
Normal file
|
@ -0,0 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
datasette analytics.db --plugins-dir=../ds/plugins --metadata=../ds/metadata.json --setting base_url $BASE_URL --host 0.0.0.0 &
|
||||
DS_PID=$!
|
||||
../ingest
|
||||
kill $DS_PID
|
Reference in a new issue