Skip to content

Commit

Permalink
Resolving #7
Browse files Browse the repository at this point in the history
subpath depmloyment #7
  • Loading branch information
hizclick committed Apr 11, 2024
1 parent 7df4e45 commit 1a1666d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
11 changes: 6 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/
COPY --from=builder /usr/app/dist/ /usr/share/nginx/html/${VUE_APP_PUBLIC_PATH}
13 changes: 8 additions & 5 deletions ngnix.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 1a1666d

Please sign in to comment.