-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'subsetter_front' into develop_v2
- Loading branch information
Showing
6 changed files
with
35 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
node_modules | ||
node_modules | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,24 @@ | ||
# in order to get the required .env, context must be app/ | ||
# docker build -f app/frontend/Dockerfile app/ | ||
FROM node:20.9.0 as build-stage | ||
WORKDIR /tmp | ||
# COPY *env* ./ | ||
# RUN [ -f ".env" ] || cp env.template .env | ||
# RUN grep '^VITE' .env > /.env | ||
|
||
WORKDIR /app | ||
COPY .env ../.env | ||
COPY ./frontend . | ||
ADD frontend . | ||
RUN npm update | ||
RUN npm run build | ||
|
||
FROM nginx:1.24.0 as production-stage | ||
RUN mkdir /app | ||
COPY --from=build-stage /app/dist /app | ||
COPY --from=build-stage /.env .env | ||
# COPY --from=build-stage .env .env | ||
COPY --from=build-stage /app/nginx.conf /etc/nginx/nginx.conf | ||
|
||
# Allow substitution of env vars at runtime | ||
COPY frontend/docker-entrypoint.sh / | ||
RUN chmod +x /docker-entrypoint.sh | ||
ENTRYPOINT ["/docker-entrypoint.sh"] | ||
EXPOSE 5003 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,14 @@ | ||
#!/bin/bash | ||
#!/bin/sh | ||
ROOT_DIR=/app | ||
# Replace env vars in files served by NGINX | ||
for file in $ROOT_DIR/assets/*.js $ROOT_DIR/index.html; | ||
do | ||
echo "Processing $file ..."; | ||
# LC_ALL=C sed -i "" 's|VITE_APP_API_URL_PLACEHOLDER|'${VITE_APP_API_URL}'|g' $file | ||
sed -i 's|VITE_APP_API_URL_PLACEHOLDER|'${VITE_APP_API_URL}'|g' $file | ||
sed -i 's|VITE_APP_FULL_URL_PLACEHOLDER|'${VITE_APP_FULL_URL}'|g' $file | ||
sed -i 's|VITE_APP_BASE_PLACEHOLDER|'${VITE_APP_BASE}'|g' $file | ||
done | ||
|
||
npm i @vue/cli-service | ||
npm install | ||
npm run build | ||
npm run serve -- --port 5003 | ||
echo "Starting Nginx" | ||
nginx -g 'daemon off;' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters