-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added support for docker (#175)
* fix: added missing titles in diffview of v2 * fix: using v2 link for sample link in docs * feat: support docker (#174) * feat: add docker * fix: nginx failed to load * docs: update README.md * chore: change to npm ci and remove static in nuxt.config.js * docs: update server to serve * docs: add Self Host section --------- Co-authored-by: Nux <[email protected]>
- Loading branch information
1 parent
f8a6926
commit ef74642
Showing
5 changed files
with
170 additions
and
1 deletion.
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,90 @@ | ||
# Created by .ignore support plugin (hsz.mobi) | ||
### Node template | ||
# Logs | ||
/logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# TypeScript v1 declaration files | ||
typings/ | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
|
||
# parcel-bundler cache (https://parceljs.org/) | ||
.cache | ||
|
||
# next.js build output | ||
.next | ||
|
||
# nuxt.js build output | ||
.nuxt | ||
|
||
# Nuxt generate | ||
dist | ||
|
||
# vuepress build output | ||
.vuepress/dist | ||
|
||
# Serverless directories | ||
.serverless | ||
|
||
# IDE / Editor | ||
.idea | ||
|
||
# Service worker | ||
sw.* | ||
|
||
# macOS | ||
.DS_Store | ||
|
||
# Vim swap files | ||
*.swp |
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,22 @@ | ||
FROM node:18 AS build-stage | ||
|
||
WORKDIR /app | ||
|
||
COPY package*.json ./ | ||
|
||
RUN npm ci | ||
|
||
COPY . . | ||
|
||
ENV NODE_OPTIONS=--openssl-legacy-provider | ||
RUN npm run generate | ||
|
||
FROM nginx:1.27.0-alpine-slim AS production-stage | ||
|
||
COPY --from=build-stage /app/dist /usr/share/nginx/html | ||
|
||
COPY nginx/default.conf /etc/nginx/conf.d/default.conf | ||
|
||
EXPOSE 80 | ||
|
||
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,16 @@ | ||
services: | ||
offline-diff-viewer: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
container_name: offline-diff-viewer | ||
ports: | ||
- "3000:80" | ||
security_opt: | ||
- no-new-privileges:true | ||
volumes: | ||
- /var/log/nginx | ||
restart: unless-stopped | ||
environment: | ||
- NODE_ENV=production | ||
- NODE_OPTIONS=--openssl-legacy-provider |
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 80; | ||
server_name offline-diff-viewer.local; | ||
|
||
location / { | ||
charset utf-8; | ||
root /usr/share/nginx/html; | ||
try_files $uri $uri/ /index.html; | ||
} | ||
|
||
error_page 500 502 503 504 /50x.html; | ||
location = /50x.html { | ||
root /usr/share/nginx/html; | ||
} | ||
} |