-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ci): change dockerfile with nginx and update env
- Loading branch information
Showing
10 changed files
with
52 additions
and
44 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,6 @@ | ||
FROM node:18-alpine | ||
|
||
WORKDIR /app | ||
|
||
COPY package*.json . | ||
|
||
RUN npm install | ||
|
||
COPY . . | ||
|
||
ARG VITE_SCANR_API_AUTHORIZATION | ||
|
||
ENV VITE_SCANR_API_AUTHORIZATION=VITE_SCANR_API_AUTHORIZATION | ||
|
||
RUN npm run build | ||
|
||
FROM nginx:stable | ||
COPY dist /usr/share/nginx/html | ||
COPY nginx.conf /etc/nginx/templates/nginx.conf.template | ||
ENV API_KEY VITE_SCANR_API_AUTHORIZATION | ||
EXPOSE 5173 | ||
|
||
CMD [ "npm", "run", "preview" ] | ||
|
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,15 @@ | ||
server { | ||
listen 5173; | ||
resolver 8.8.8.8; | ||
location / { | ||
root /usr/share/nginx/html; | ||
index index.html index.htm; | ||
try_files $uri $uri/ /index.html =404; | ||
} | ||
location ~ ^/api/(.*)$ { | ||
proxy_set_header Authorization 'Basic $API_KEY'; | ||
proxy_set_header Accept application/json; | ||
proxy_set_header Content-Type application/json; | ||
client_max_body_size 10M; | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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,3 @@ | ||
const { VITE_SCANR_API_AUTHORIZATION: API_KEY } = import.meta.env; | ||
export const headers = API_KEY ? { Authorization: `Basic ${API_KEY}` } : {}; | ||
export const postHeaders = { ...headers, "Content-Type": "application/json" }; |
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 @@ | ||
/// <reference types="vite/client" /> |
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