1
Fork 0

Add abillity for ui to be served from a subpath (#24)

Add env variable for ui served from a subpath
This commit is contained in:
Viktor Strate Kløvedal 2020-04-15 21:16:36 +02:00 committed by GitHub
parent 9819280fc9
commit 4105275ba9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View File

@ -4,6 +4,9 @@ FROM node:10 as ui
ARG API_ENDPOINT
ENV API_ENDPOINT=${API_ENDPOINT}
ARG UI_PUBLIC_URL
ENV UI_PUBLIC_URL=${UI_PUBLIC_URL}
RUN mkdir -p /app
WORKDIR /app
@ -11,7 +14,7 @@ COPY ui/package*.json /app/
RUN npm install
COPY ui /app
RUN npm run build
RUN npm run build -- --public-url $UI_PUBLIC_URL
# Build API
FROM golang:alpine AS api

View File

@ -16,6 +16,10 @@ services:
build:
context: "."
args:
- UI_PUBLIC_URL=/
# Change This: The url from which the web ui can access the backend
# Should by default be the value of PUBLIC_ENDPOINT with /api appended to it
- API_ENDPOINT=http://localhost:8000/api/
restart: always
@ -31,7 +35,7 @@ services:
- PHOTO_CACHE=/app/cache
- SERVE_UI=1
# Change This: The publicly exposed url for the api
# Change This: The publicly exposed url
# For example if the server is available from the domain example.com,
# change this value to http://example.com/
- PUBLIC_ENDPOINT=http://localhost:8000/