Skip to content

Commit

Permalink
Merge pull request #298 from TaloDev/docker-substitution-step
Browse files Browse the repository at this point in the history
Prevent env vars being substituted with empty at Dockerfile level
  • Loading branch information
tudddorrr authored Oct 8, 2024
2 parents d317c6c + e8c57fd commit c7ee522
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .env.production
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VITE_API_URL=\${API_URL}
VITE_API_URL=${API_URL}

VITE_SENTRY_DSN=\${SENTRY_DSN}
VITE_SENTRY_DSN=${SENTRY_DSN}
VITE_SENTRY_ENV=prod
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
FROM node:20-alpine AS build
WORKDIR /usr/frontend
COPY . .

# prepend \ to variables that need to be substituted
# this prevents them from being substituted with empty values
RUN sed -i 's/\${/\\${/g' .env.production

RUN npm install
RUN npm run build

Expand Down

0 comments on commit c7ee522

Please sign in to comment.