-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build on metal, serve using static-web-server
- Loading branch information
1 parent
9ac4b35
commit 9c928d5
Showing
12 changed files
with
162 additions
and
271 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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# This file contains placeholder values which will be overwritten by ./docker-entrypoint.sh. | ||
|
||
VITE_CHRIS_UI_URL="b87f4fda-012a-4564-8c36-096e496cbedf" | ||
VITE_CHRIS_UI_USERS_URL="b87f4fda-012a-4564-8c36-096e496cbedfusers/" | ||
VITE_CHRIS_UI_AUTH_URL="b87f4fda-012a-4564-8c36-096e496cbedfauth-token/" | ||
|
||
VITE_CHRIS_STORE_URL="79e63221-ccf9-43c3-bf0d-45d05db72c48" | ||
|
||
VITE_PFDCM_URL="700e747e-619f-4007-ad8d-47677c0d0b46" | ||
|
||
VITE_OHIF_URL="ea1cf042-73f0-43a1-93da-86ff93e5ac19" | ||
|
||
VITE_ALPHA_FEATURES='production' | ||
|
||
VITE_SOURCEMAP='false' | ||
|
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,51 +1,26 @@ | ||
# ChRIS_ui production mode server | ||
# Production image for ChRIS_ui. | ||
# | ||
# Build with | ||
# This is a simple image containing a static web server and the build assets. | ||
# | ||
# docker build -t <name> . | ||
# The web application needs to be built on-the-metal before building this container image. | ||
# Instructions: | ||
# | ||
# For example if building a local version, you could do: | ||
# pnpm build && docker build -t localhost/fnndsc/chris_ui:latest . | ||
# | ||
# docker build -t local/chris_ui . | ||
# | ||
# In the case of a proxy (located at say 10.41.13.4:3128), do: | ||
# | ||
# export PROXY="http://10.41.13.4:3128" | ||
# docker build --build-arg http_proxy=${PROXY} -t local/chris_ui . | ||
# | ||
# To run the server up, do: | ||
# | ||
# docker run --name chris_ui -p 3000:3000 -d local/chris_ui | ||
# | ||
# To run an interactive shell inside this container, do: | ||
# | ||
# docker exec -it chris_ui sh | ||
# | ||
# Tips: | ||
# - for access logging, remove "--quiet" from CMD | ||
# - docker-entrypoint.sh must start as root | ||
|
||
FROM ghcr.io/static-web-server/static-web-server:2.33.0-alpine | ||
|
||
FROM node:20.17 as builder | ||
COPY ./dist /build | ||
COPY ./.env.production /build/.env.production | ||
|
||
WORKDIR /app | ||
COPY . . | ||
|
||
|
||
RUN npm ci | ||
RUN npm run build | ||
|
||
|
||
FROM node:20.17-alpine | ||
COPY ./docker-entrypoint.sh /docker-entrypoint.sh | ||
|
||
RUN npm i -g sirv-cli | ||
|
||
WORKDIR /app | ||
COPY ./static-web-server.toml /etc/static-web-server/config.toml | ||
ENV SERVER_CONFIG_FILE=/etc/static-web-server/config.toml | ||
|
||
COPY --from=builder /app/dist /app | ||
COPY ./docker-entrypoint.sh /docker-entrypoint.sh | ||
RUN chmod 444 /build/.env.production && chmod g+rwx /srv \ | ||
&& chmod 550 /etc/static-web-server && chmod 440 /etc/static-web-server/* | ||
|
||
ENTRYPOINT ["/docker-entrypoint.sh"] | ||
ENV HOST=0.0.0.0 PORT=3000 | ||
CMD ["sirv", "--etag", "--single"] | ||
EXPOSE 3000 | ||
CMD ["static-web-server"] |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.