-
-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added docker image build script (#245)
* Added docker image build script * Changed to alpine docker and expose port 9180 * Use multi-stage build --------- Co-authored-by: = <=> Co-authored-by: Jeff <[email protected]>
- Loading branch information
Showing
3 changed files
with
38 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# --- Builder stage | ||
FROM node:18-alpine as builder | ||
WORKDIR /app | ||
COPY . /app | ||
|
||
# Scripts include electron-specific dependencies, which we don't need | ||
RUN npm install --legacy-peer-deps --ignore-scripts | ||
RUN npm run build:web | ||
|
||
# --- Production stage | ||
FROM nginx:alpine-slim | ||
|
||
COPY --from=builder /app/release/app/dist/web /usr/share/nginx/html | ||
COPY nginx.conf /etc/nginx/conf.d/default.conf | ||
|
||
EXPOSE 9180 | ||
CMD ["nginx", "-g", "daemon off;"] |
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,20 @@ | ||
server { | ||
listen 9180; | ||
sendfile on; | ||
default_type application/octet-stream; | ||
|
||
gzip on; | ||
gzip_http_version 1.1; | ||
gzip_disable "MSIE [1-6]\."; | ||
gzip_min_length 256; | ||
gzip_vary on; | ||
gzip_proxied expired no-cache no-store private auth; | ||
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript; | ||
gzip_comp_level 9; | ||
|
||
root /usr/share/nginx/html; | ||
|
||
location / { | ||
try_files $uri $uri/ /index.html =404; | ||
} | ||
} |
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
18e35f2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
feishin – ./
feishin.vercel.app
feishin-jeffvli.vercel.app
feishin-git-development-jeffvli.vercel.app