Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

Ship db-ip database with docker image

Blue Mouse8bc418e0aa6d
diff --git a/backend/Dockerfile b/backend/Dockerfile
index 23c132a4e..5816b9c2c 100644
--- a/backend/Dockerfile
+++ b/backend/Dockerfile
@@ -3,9 +3,11 @@ FROM node:lts-alpine as build
WORKDIR /build
COPY . .
RUN npm i -g pnpm && pnpm i && npm run deploy:selfhosted
+RUN node ./meta/dbip-sync.js
#Stage 2
FROM node:lts-alpine as run
+LABEL maintainer="swetrix.com <[email protected]>"
ENV TZ=UTC \
JWT_ACCESS_TOKEN_SECRET=jwt-access-token-secret \
JWT_REFRESH_TOKEN_SECRET=jwt-refresh-token-secret \
@@ -22,13 +24,16 @@ ENV TZ=UTC \
PASSWORD=12345678 \
API_KEY=\
+ DEBUG_MODE=\
+ IP_GEOLOCATION_DB_PATH=\
IS_PRIMARY_NODE=true
RUN apk add --no-cache tzdata && cp /usr/share/zoneinfo/$TZ /etc/localtime
WORKDIR /app
COPY --from=build /build/package*.json ./
COPY --from=build /build/dist/ ./dist/
+COPY --from=build /build/dbip-city-lite.mmdb ./dbip-city-lite.mmdb
COPY --from=build /build/migrations ./migrations
COPY --from=build /build/node_modules/ ./node_modules/
CMD [ "npm", "run", "start:prod" ]
EXPOSE 5005
-HEALTHCHECK CMD wget -nv -t1 --spider 'http://localhost:5005/ping' || exit 1
\ No newline at end of file
+HEALTHCHECK CMD wget -nv -t1 --spider 'http://localhost:5005/ping' || exit 1