-
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.
feat: optimize build process & switch to nginx container (#20)
This fixes the CORS issue when running the container in prod as well. The API URL is currently specified in multiple places. Added vite optimize to the build script. fixes #18
- Loading branch information
1 parent
49f3649
commit 0442a83
Showing
4 changed files
with
23 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
FROM node:21-alpine | ||
FROM node:21-alpine as build | ||
|
||
WORKDIR /app | ||
|
||
COPY . . | ||
RUN npm install | ||
RUN npx vite build | ||
RUN npx vite optimize | ||
RUN npm ci | ||
RUN npm run build | ||
|
||
EXPOSE 4173 | ||
FROM nginx:latest | ||
|
||
CMD [ "npx", "vite", "preview" ] | ||
COPY --from=build /app/dist/ /usr/share/nginx/html | ||
COPY nginx/nginx.conf /etc/nginx/conf.d/default.conf |
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,14 @@ | ||
server { | ||
listen 80; | ||
server_name _; | ||
|
||
root /usr/share/nginx/html; | ||
index index.html; | ||
|
||
location / { | ||
try_files $uri /index.html; | ||
} | ||
location /tiles { | ||
proxy_pass "https://dl2sa.blob.core.windows.net/public3d/katukuntotieto"; | ||
} | ||
} |
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