Skip to content

Commit

Permalink
Merge pull request #197 from walt-id/fix-docker-cherrypick
Browse files Browse the repository at this point in the history
Fix Docker build
  • Loading branch information
waltkb committed Mar 5, 2024
2 parents 2ebaf9e + cfc98eb commit 152f101
Show file tree
Hide file tree
Showing 10 changed files with 68 additions and 614 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
*/build
*/.nuxt
*/node_modules
.gradle
.idea
.run
Expand Down
16 changes: 16 additions & 0 deletions waltid-web-wallet/.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -500,3 +500,19 @@ Icon
Network Trash Folder
Temporary Items
.apdisk

node_modules
Dockerfile*
docker-compose*
.dockerignore
.git
.gitignore
README.md
LICENSE
.vscode
Makefile
helm-charts
.env
.editorconfig
.idea
coverage*
47 changes: 34 additions & 13 deletions waltid-web-wallet/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,40 @@
# BUILD
FROM docker.io/oven/bun:1 as buildstage

COPY waltid-web-wallet /build
# use the official Bun image
# see all versions at https://hub.docker.com/r/oven/bun/tags
FROM oven/bun:1 as base
WORKDIR /app

WORKDIR /build
RUN bun install
# install dependencies into temp directory
# this will cache them and speed up future builds
FROM base AS install
RUN mkdir -p /temp/dev
COPY package.json bun.lockb /temp/dev/
RUN cd /temp/dev && bun install --frozen-lockfile

RUN bun run build
# install with --production (exclude devDependencies)
RUN mkdir -p /temp/prod
COPY package.json bun.lockb /temp/prod/
RUN cd /temp/prod && bun install --frozen-lockfile --production

# RUN
FROM docker.io/node:alpine
COPY --from=buildstage /build/.output/ /app
# copy node_modules from temp directory
# then copy all (non-ignored) project files into the image
FROM base AS prerelease
COPY --from=install /temp/dev/node_modules node_modules
COPY . .

WORKDIR /app
# [optional] tests & build
ENV NODE_ENV=production
RUN bun test
RUN bun run build

EXPOSE 7101
ENTRYPOINT node server/index.mjs
# copy production dependencies and source code into final image
FROM base AS release
COPY --from=install /temp/prod/node_modules node_modules
COPY --from=prerelease /app/.output/ .
COPY --from=prerelease /app/package.json .

# run the app
RUN chmod -R a+r .
USER bun
EXPOSE 7101/tcp
ENV PORT=7101
ENTRYPOINT [ "bun", "run", "server/index.mjs" ]
14 changes: 1 addition & 13 deletions waltid-web-wallet/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ export default defineNuxtConfig({
srcDir: "src",
modules: [
"@vueuse/nuxt",
// "@nuxtjs/tailwindcss",
["@unocss/nuxt", { autoImport: false }],
"@nuxtjs/i18n",
"@nuxtjs/color-mode",
Expand Down Expand Up @@ -38,12 +37,6 @@ export default defineNuxtConfig({
isEnabled: true
}
},
postcss: {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
},
pwa: {
registerWebManifestInRouteRules: true,

Expand Down Expand Up @@ -158,10 +151,6 @@ export default defineNuxtConfig({
storageKey: "color-mode"
},

/*tailwindcss: {
configPath: "./tailwind.config.js"
},*/

vite: {
logLevel: "info"
/*server: {
Expand Down Expand Up @@ -189,8 +178,7 @@ export default defineNuxtConfig({
"/wallet-api/": "http://localhost:7001/wallet-api"
}
},
ssr: false,
css: ["@near-wallet-selector/modal-ui/styles.css"]
ssr: false

// i18n: {
// lazy: true,
Expand Down
47 changes: 10 additions & 37 deletions waltid-web-wallet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,41 +18,14 @@
"@headlessui/vue": "1.7.19",
"@heroicons/vue": "^2.1.1",
"@julr/unocss-preset-forms": "^0.1.0",
"@near-wallet-selector/coin98-wallet": "^8.5.3",
"@near-wallet-selector/core": "^8.5.3",
"@near-wallet-selector/here-wallet": "^8.5.3",
"@near-wallet-selector/ledger": "^8.5.3",
"@near-wallet-selector/math-wallet": "^8.5.3",
"@near-wallet-selector/modal-ui": "^8.5.3",
"@near-wallet-selector/my-near-wallet": "^8.5.3",
"@near-wallet-selector/narwallets": "^8.5.3",
"@near-wallet-selector/near-wallet": "^8.5.3",
"@near-wallet-selector/nearfi": "^8.5.3",
"@near-wallet-selector/neth": "^8.5.3",
"@near-wallet-selector/nightly": "^8.5.3",
"@near-wallet-selector/nightly-connect": "^8.5.3",
"@near-wallet-selector/opto-wallet": "^8.5.3",
"@near-wallet-selector/sender": "^8.5.3",
"@near-wallet-selector/wallet-connect": "^8.5.3",
"@near-wallet-selector/welldone-wallet": "^8.5.3",
"@near-wallet-selector/xdefi": "^8.5.3",
"@pinia/nuxt": "^0.5.1",
"@polkadot/extension-dapp": "^0.46.6",
"@randlabs/myalgo-connect": "^1.4.2",
"@temple-wallet/dapp": "^8.0.0",
"@wagmi/core": "^1.4.6",
"@walletconnect/auth-client": "^2.1.2",
"@web3modal/ethereum": "^2.7.1",
"@web3modal/wagmi": "^3.3.1",
"jsonpath-plus": "^8.0.0",
"near-api-js": "^2.1.4",
"qr-scanner": "^1.4.2",
"qrcode.vue": "^3.4.1",
"viem": "^1.19.1"
"qrcode.vue": "^3.4.1"
},
"devDependencies": {
"@antfu/eslint-config": "2.6.4",
"@iconify-json/carbon": "1.1.30",
"@antfu/eslint-config": "2.8.0",
"@iconify-json/carbon": "1.1.31",
"@iconify-json/ic": "1.1.17",
"@iconify-json/ph": "1.1.11",
"@iconify-json/twemoji": "1.1.15",
Expand All @@ -64,20 +37,20 @@
"@unocss/transformer-directives": "^0.58.5",
"@unocss/transformer-variant-group": "^0.58.5",
"@vite-pwa/nuxt": "^0.5.0",
"@vueuse/core": "^10.8.0",
"@vueuse/nuxt": "10.8.0",
"eslint": "8.56.0",
"@vueuse/core": "^10.9.0",
"@vueuse/nuxt": "10.9.0",
"eslint": "8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-vue": "9.21.1",
"nuxt": "3.10.2",
"eslint-plugin-vue": "9.22.0",
"nuxt": "3.10.3",
"nuxt-icon": "^0.6.8",
"nuxt-oidc-auth": "^0.9.11",
"prettier": "^3.2.5",
"prettier-plugin-tailwindcss": "^0.5.11",
"sass": "1.71.0",
"sass": "1.71.1",
"sass-loader": "14.1.1",
"typescript": "5.3.3",
"vite-plugin-pwa": "^0.19.0"
"vite-plugin-pwa": "^0.19.2"
}
}
Loading

0 comments on commit 152f101

Please sign in to comment.