create entry-point script to get all env variables starting with VUE_APP_ and take it's value I would like to Dockerize my existing vuejs app for staging , production and I used multi staged approach to create my app container and I'm using Ubuntu 18.04 and this is my,
Dockerfile
# build stage
FROM node:lts-alpine as build-stage

LABEL maintainer=&quot;servers@xpl.com&quot;

WORKDIR /app

COPY package*.json ./

RUN npm install

COPY . ./

RUN npm run build

# production stage
FROM nginx:stable-alpine

LABEL maintainer=&quot;servers@xpl.com&quot;

COPY --from=build-stage /app/dist/ /app/dist/

COPY nginx/nginx.conf /etc/nginx/

EXPOSE 80

I don't want to create docker-compose.yml file to assign anything and my question would be like , Create .env file with hardcoded values.
i.e
VUE_APP_API_ENDPOINT_DOMAIN=VUE_APP_API_ENDPOINT_DOMAIN

1 .When running npm run build it'll put VUE_APP_API_ENDPOINT_DOMAIN in the dest files.
2 .We need to know which file. Probably index.html I believe.
3 .We create entry-point.sh script will get all env variables starting with VUE_APP_ and take it's value. And then using sed command we find and replace those hard coded variable placeholders in index.html.
And finally start Nginx.
I was stuck on step 3.
While it's not clear what your trying to do (the script you have so far for the bit you are having trouble with would probably be handy), I think you are essentially just trying to parse your environment and manipulate the variables at the start of your script?

I don't see why add something like this to the first line of your script wouldn't work:

eval $(typeset -p | grep -E 'declare -x VUE_APP_' | sed -e 's#declare -x VUE_APP_#export VUE_APP_#g')


But then I also don't know what shell you're running or anything else about the container, so I'm not sure..