Added docker support
This commit is contained in:
parent
ccc5337dc1
commit
113f0c647b
5 changed files with 77 additions and 1 deletions
22
frontend/Dockerfile
Normal file
22
frontend/Dockerfile
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
FROM node:18 AS frontend-build
|
||||
|
||||
WORKDIR /app/frontend
|
||||
|
||||
COPY ./package.json ./package-lock.json ./
|
||||
RUN npm install
|
||||
|
||||
COPY ./ ./
|
||||
RUN npm run build
|
||||
|
||||
FROM nginx:stable AS runtime
|
||||
|
||||
WORKDIR /usr/share/nginx/html
|
||||
|
||||
COPY --from=frontend-build /app/frontend/dist .
|
||||
COPY ./envVars.sh /docker-entrypoint.d/
|
||||
|
||||
RUN chmod +x /docker-entrypoint.d/envVars.sh
|
||||
|
||||
ENV BACKEND=
|
||||
|
||||
EXPOSE 80
|
||||
5
frontend/envVars.sh
Executable file
5
frontend/envVars.sh
Executable file
|
|
@ -0,0 +1,5 @@
|
|||
SETTINGFILE=`find /usr/share/nginx/html/_astro/ -name 'CardList.*.js'`
|
||||
|
||||
echo "Setting backend in $SETTINGFILE to $BACKEND"
|
||||
|
||||
sed -i "s#ENDPOINT#$BACKEND#g" $SETTINGFILE
|
||||
|
|
@ -3,5 +3,5 @@ export interface ConfigType {
|
|||
}
|
||||
|
||||
export const Config: ConfigType = {
|
||||
endpoint: "http://localhost:5107/Service",
|
||||
endpoint: "ENDPOINT/Service",
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue