Skip to content
Snippets Groups Projects
Commit d1838a37 authored by esikkala's avatar esikkala
Browse files

Remove Google API variables from Dockerfile

parent 316a9f9c
No related branches found
No related tags found
No related merge requests found
FROM node:14.15.1-alpine FROM node:14.15.1-alpine
ARG API_URL ARG API_URL
ARG GOOGLE_APPLICATION_CREDENTIALS
ARG SHEETS_API_SHEET_ID
# Create app directory # Create app directory
RUN mkdir /opt/app && chown node:node /opt/app RUN mkdir /opt/app && chown node:node /opt/app
...@@ -23,19 +21,12 @@ COPY babel.config.js ./ ...@@ -23,19 +21,12 @@ COPY babel.config.js ./
# Bundle app source # Bundle app source
COPY src ./src COPY src ./src
# If translations are fetched from Google Sheets API,
# the 'node' user needs to be able to write into this folder
RUN chown -R node:node ./src/client/translations
# https://github.com/nodejs/docker-node/blob/main/docs/BestPractices.md#non-root-user # https://github.com/nodejs/docker-node/blob/main/docs/BestPractices.md#non-root-user
USER node USER node
# Run the scripts defined in package.json # Run the scripts defined in package.json
RUN npm install && \ RUN npm install && \
API_URL=$API_URL \ API_URL=$API_URL npm run build
GOOGLE_APPLICATION_CREDENTIALS=$GOOGLE_APPLICATION_CREDENTIALS \
SHEETS_API_SHEET_ID=$SHEETS_API_SHEET_ID \
npm run build
EXPOSE 3001 EXPOSE 3001
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment