diff --git a/Dockerfile b/Dockerfile index 4c77715..a61c085 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,15 +3,16 @@ ARG VUE_APP_PUBLIC_PATH="" ENV VUE_APP_PUBLIC_PATH=$VUE_APP_PUBLIC_PATH WORKDIR /usr/app COPY . . -RUN echo "VUE_APP_CLIENT_ID=$CLIENT_ID" >.env.development.local -RUN echo "VUE_APP_CLIENT_SECRET=$CLIENT_SECRET" >.env.development.local -RUN echo "VUE_APP_CALL_BACK=$CALL_BACK" >.env.development.local +# RUN echo "VUE_APP_CLIENT_ID=$CLIENT_ID" >.env.development.local +# RUN echo "VUE_APP_CLIENT_SECRET=$CLIENT_SECRET" >.env.development.local +# RUN echo "VUE_APP_CALL_BACK=$CALL_BACK" >.env.development.local RUN npm install --legacy-peer-deps --force && npm run build FROM nginx:alpine - +ARG VUE_APP_PUBLIC_PATH="" +ENV VUE_APP_PUBLIC_PATH=$VUE_APP_PUBLIC_PATH WORKDIR /etc/nginx COPY 40-create-ghcred.sh /docker-entrypoint.d COPY ngnix.conf /etc/nginx/nginx.d/default.conf -COPY --from=builder /usr/app/dist/ /usr/share/nginx/html/test/ \ No newline at end of file +COPY --from=builder /usr/app/dist/ /usr/share/nginx/html/${VUE_APP_PUBLIC_PATH} \ No newline at end of file diff --git a/ngnix.conf b/ngnix.conf index 136c096..71ee049 100644 --- a/ngnix.conf +++ b/ngnix.conf @@ -19,13 +19,16 @@ server { } # Serve Vue.js application from VUE_APP_PUBLIC_PATH - location / { - alias /usr/share/nginx/html$VUE_APP_PUBLIC_PATH; - try_files $uri $uri/ $VUE_APP_PUBLIC_PATH/index.html; - } - + + # default rule to access app + location / { + root /usr/share/nginx/html; + index index.html; + try_files $uri $uri/ /index.html; + } # Redirect requests without trailing slash to include it location ~ ^(.*)/$ { return 301 $1; } } +s \ No newline at end of file