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!

add env vars to docker

Alper Alkan2c4653289598
diff --git a/Dockerfile b/Dockerfile
index b9c484152..d8e29b7d1 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,6 +1,10 @@
# Stage 1
FROM node:lts-alpine as build
ENV TZ=Etc/UTC
+ENV REACT_APP_API_URL="https://example.com/api/"
+ENV REACT_APP_TITLE_SUFFIX="| Swetrix"
+ENV CHOKIDAR_USEPOLLING=true
+ENV GENERATE_SOURCEMAP=false
RUN apk add --no-cache tzdata && cp /usr/share/zoneinfo/$TZ /etc/localtime
WORKDIR /app
COPY . .
@@ -8,8 +12,8 @@ RUN npm install -g pnpm && pnpm install && npm run build
# Stage 2
FROM nginx:stable-alpine
-RUN rm -rf /usr/share/nginx/html/*
ENV TZ=Etc/UTC
+RUN rm -rf /usr/share/nginx/html/*
RUN apk add --no-cache tzdata && cp /usr/share/zoneinfo/$TZ /etc/localtime
COPY --from=build /app/deployment/default.conf /etc/nginx/conf.d/default.conf
COPY --from=build /app/build /usr/share/nginx/html