Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FROM node:lts-alpine AS build ARG TOOLZ_REPO="https://github.com/CorentinTh/it-tools.git" RUN apk add --no-cache git \ && rm -rf /var/cache/apk/* WORKDIR /app RUN git clone ${TOOLZ_REPO} toolz WORKDIR /app/toolz # make sub url ARG SUB_URL= RUN if [[ -n "$SUB_URL" ]] \ ; then \ sed -i -e "s|href=\"/|href=\"|" index.html \ && sed -i -e "s|src: \'/|src: \'|" vite.config.ts \ && sed -i -e "s|routes:|base: config.app.baseUrl, routes:|" src/router.ts \ && sed -i -e "s|resolve:|base: process.env.SUB_URL + '/', resolve:|" vite.config.ts \ && sed -i -e "s|default: '/',|default: process.env.SUB_URL,|" src/config.ts \ && sed -i -e "s|start_url: '/?utm_source=pwa&utm_medium=pwa',|start_url: process.env.SUB_URL + '/?utm_source=pwa\&utm_medium=pwa',|" vite.config.ts \ ; fi # compile RUN npm install -g pnpm \ && pnpm i --frozen-lockfile \ && pnpm build FROM nginx:stable-alpine AS production COPY --from=build /app/toolz/dist /usr/share/nginx/html COPY --from=build /app/toolz/nginx.conf /etc/nginx/conf.d/default.conf EXPOSE 80 CMD ["nginx", "-g", "daemon off;"]
change arg SUB_URL to need subfolder ex: ARG SUB_URL=/sub for http://domain.org/sub/ build image:
ARG SUB_URL=/sub
http://domain.org/sub/
docker build -t it-tools:mode /folder_with_dockerfile/. -f /folder_with_dockerfile/Dockerfile
The text was updated successfully, but these errors were encountered:
@CorentinTh Do you plan to add this excellent option in the it-tools code?
change arg SUB_URL to need subfolder
ex:
ARG SUB_URL=/sub
forhttp://domain.org/sub/
build image:
docker build -t it-tools:mode /folder_with_dockerfile/. -f /folder_with_dockerfile/Dockerfile
The text was updated successfully, but these errors were encountered: