added geonames_username env var to docker, frontend needs env build-time

This commit is contained in:
Aaro Koivukangas
2024-11-18 10:23:20 +01:00
parent 71375c237d
commit 3d50d8c243
4 changed files with 6 additions and 1 deletions
+1 -1
View File
@@ -58,7 +58,7 @@ jobs:
- uses: actions/checkout@v4
- name: Build image
run: docker build frontend --tag $FRONTEND_IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}" --build-arg BACKEND_URL=${BACKEND_URL} --build-arg RUNNING_ENV=${RUNNING_ENV} --build-arg ENABLE_WRITE=${ENABLE_WRITE} --target serve
run: docker build frontend --tag $FRONTEND_IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}" --build-arg BACKEND_URL=${BACKEND_URL} --build-arg RUNNING_ENV=${RUNNING_ENV} --build-arg ENABLE_WRITE=${ENABLE_WRITE} --build-arg GEONAMES_USERNAME=${{ secrets.GEONAMES_USERNAME }}--target serve
- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
+1
View File
@@ -10,6 +10,7 @@ services:
BACKEND_URL: http://localhost:4000
ENABLE_WRITE: true
RUNNING_ENV: prod
GEONAMES_USERNAME: '${GEONAMES_USERNAME}'
ports:
- 127.0.0.1:5173:5173
+2
View File
@@ -3,12 +3,14 @@ FROM node:22-alpine3.20 AS build
ARG BACKEND_URL="http://localhost:4000"
ARG ENABLE_WRITE="false"
ARG RUNNING_ENV
ARG GEONAMES_USERNAME
ENV TZ="Europe/Helsinki"
ENV VITE_BACKEND_URL=$BACKEND_URL
ENV VITE_RUNNING_ENV=$RUNNING_ENV
ENV VITE_ENABLE_WRITE=$ENABLE_WRITE
ENV VITE_GEONAMES_USERNAME=$GEONAMES_USERNAME
USER node
WORKDIR /app
+2
View File
@@ -3,12 +3,14 @@ FROM node:22-alpine3.20
ARG BACKEND_URL="http://localhost:4000"
ARG ENABLE_WRITE="false"
ARG RUNNING_ENV
ARG GEONAMES_USERNAME
ENV TZ="Europe/Helsinki"
ENV VITE_BACKEND_URL=$BACKEND_URL
ENV VITE_RUNNING_ENV=$RUNNING_ENV
ENV VITE_ENABLE_WRITE=$ENABLE_WRITE
ENV VITE_GEONAMES_USERNAME=$GEONAMES_USERNAME
USER node
WORKDIR /usr/src/app