Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Cobalt Web image Dockerfile#1366

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
jo-chemla wants to merge2 commits intoimputnet:main
base:main
Choose a base branch
Loading
fromjo-chemla:web-docker-image

Conversation

@jo-chemla
Copy link

Build and run image with

docker build -f web/Dockerfile -t cobalt-web .docker run -e WEB_DEFAULT_API="https://real.api.endpoint" -e WEB_HOST="http://abc"  -e WEB_PLAUSIBLE_HOST="def" -p 800:80 cobalt-web

Currently, vite build still uses process.env env-vars at build time, so the docker container is not using those defined via placeholders inruntime-config.js

Build and run image with```docker build -f web/Dockerfile -t cobalt-web .docker run -e WEB_DEFAULT_API="https://real.api.endpoint" -e WEB_HOST="http://abc"  -e WEB_PLAUSIBLE_HOST="def" -p 800:80 cobalt-web```Currently, vite build still uses process.env env-vars at build time, so the docker container is not using those defined via placeholders in `runtime-config.js`
@hyperdefined
Copy link
Contributor

Should use Caddy instead of NGINX.

This is my Dockerfile for hosting web:https://github.com/caninetools/cobalt/blob/main/docker-build/Dockerfile-web

DenuxPlays reacted with thumbs up emojispectrapulse reacted with thumbs down emoji

Thanks for getting back@hyperdefined with the direction about using Caddy.I cannot comment on the issue thread or PR anymore.This is a fake commit to comment: do you want to edit the PR with your Dockerfile and make the vars editable via docker container env_vars?
@jo-chemla
Copy link
Author

Thanks for getting back@hyperdefined with the direction about using Caddy.
Do you want to edit the PR with your Dockerfile and make the vars editable via docker container env_vars?
Or should I give it a go on my side? Note it seems like it's currently working great with nginx.

@hyperdefined
Copy link
Contributor

hyperdefined commentedJul 2, 2025
edited
Loading

I swapped to Caddy since I like it better personally, and I like how it's more lightweight.

As for the environment variables, they are in the build file itself. You can edit them yourself or manually copy in a.env file into the root of the web folder before the site is built.

The site is built in the container before it's published, so passing in environment variables during runtime won't do anything. It has to be done before it's built.

@jo-chemla
Copy link
Author

Thanks again for getting back! What's the point-of-view of the team regarding nginx vs Caddy for thiscobalt-web docker image?

Also, this PR uses adocker-entrypoint.sh which replaces runtime docker env variablesWEB_HOST, WEB_PLAUSIBLE_HOST, WEB_DEFAULT_API into placeholders in aruntime-config.js file. Only at the moment thisconfig-file.js is not read by the built site.

hyperdefined reacted with thumbs up emoji

@verncat
Copy link

bump

@verncat
Copy link

verncat commentedJul 21, 2025
edited
Loading

I tried to build image by following your instruction, but it didn't worked
It fails insyscall-napi install

docker build output
~/cobald/$ podman build -f web/Dockerfile -t cobalt-web . --no-cache[1/2] STEP 1/7: FROM node:20-alpine AS builder[1/2] STEP 2/7: WORKDIR /repo--> 54d8f8ca80ed[1/2] STEP 3/7: RUN npm install -g pnpm added 1 package in 2s1 package is looking for funding  run `npm fund` for detailsnpm noticenpm notice New major version of npm available! 10.8.2 -> 11.4.2npm notice Changelog: https://github.com/npm/cli/releases/tag/v11.4.2npm notice To update run: npm install -g npm@11.4.2npm notice--> 7855d94a9fed[1/2] STEP 4/7: COPY . .--> 3ad3da131971[1/2] STEP 5/7: RUN pnpm install --frozen-lockfileScope: all 5 workspace projectsLockfile is up to date, resolution step is skippedProgress: resolved 1, reused 0, downloaded 0, added 0Packages: +395++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++Progress: resolved 395, reused 0, downloaded 80, added 79Progress: resolved 395, reused 0, downloaded 235, added 232Progress: resolved 395, reused 0, downloaded 354, added 352Progress: resolved 395, reused 0, downloaded 393, added 392Progress: resolved 395, reused 0, downloaded 394, added 392Progress: resolved 395, reused 0, downloaded 395, added 394Progress: resolved 395, reused 0, downloaded 395, added 395Progress: resolved 395, reused 0, downloaded 395, added 395, done.../node_modules/ffmpeg-static install$ node install.js.../node_modules/syscall-napi install$ node-gyp rebuild.../node_modules/svelte-preprocess postinstall$ echo "[svelte-preprocess] Don't forget to install the preprocessors packages that will be used: sass, stylus, less, postcss & postcss-load-config, coffeescript, pug, etc...".../esbuild@0.21.5/node_modules/esbuild postinstall$ node install.js.../esbuild@0.23.0/node_modules/esbuild postinstall$ node install.js.../node_modules/svelte-preprocess postinstall: [svelte-preprocess] Don't forget to install the preprocessors packages that will be used: sass, stylus, less, postcss & postcss-load-config, coffeescript, pug, etc....../node_modules/svelte-preprocess postinstall: Done.../node_modules/syscall-napi install: gyp info it worked if it ends with ok.../node_modules/syscall-napi install: gyp info using node-gyp@10.1.0.../node_modules/syscall-napi install: gyp info using node@20.19.4 | linux | x64.../esbuild@0.21.5/node_modules/esbuild postinstall: Done.../node_modules/syscall-napi install: gyp ERR! find Python .../node_modules/syscall-napi install: gyp ERR! find Python Python is not set from command line or npm configuration.../node_modules/syscall-napi install: gyp ERR! find Python Python is not set from environment variable PYTHON.../node_modules/syscall-napi install: gyp ERR! find Python checking if "python3" can be used.../node_modules/syscall-napi install: gyp ERR! find Python - executable path is "".../node_modules/syscall-napi install: gyp ERR! find Python - "" could not be run.../node_modules/syscall-napi install: gyp ERR! find Python checking if "python" can be used.../node_modules/syscall-napi install: gyp ERR! find Python - executable path is "".../node_modules/syscall-napi install: gyp ERR! find Python - "" could not be run.../node_modules/syscall-napi install: gyp ERR! find Python .../node_modules/syscall-napi install: gyp ERR! find Python **********************************************************.../node_modules/syscall-napi install: gyp ERR! find Python You need to install the latest version of Python..../node_modules/syscall-napi install: gyp ERR! find Python Node-gyp should be able to find and use Python. If not,.../node_modules/syscall-napi install: gyp ERR! find Python you can try one of the following options:.../node_modules/syscall-napi install: gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable".../node_modules/syscall-napi install: gyp ERR! find Python (accepted by both node-gyp and npm).../node_modules/syscall-napi install: gyp ERR! find Python - Set the environment variable PYTHON.../node_modules/syscall-napi install: gyp ERR! find Python - Set the npm configuration variable python:.../node_modules/syscall-napi install: gyp ERR! find Python npm config set python "/path/to/pythonexecutable".../node_modules/syscall-napi install: gyp ERR! find Python For more information consult the documentation at:.../node_modules/syscall-napi install: gyp ERR! find Python https://github.com/nodejs/node-gyp#installation.../node_modules/syscall-napi install: gyp ERR! find Python **********************************************************.../node_modules/syscall-napi install: gyp ERR! find Python .../node_modules/syscall-napi install: gyp ERR! configure error .../node_modules/syscall-napi install: gyp ERR! stack Error: Could not find any Python installation to use.../node_modules/syscall-napi install: gyp ERR! stack at PythonFinder.fail (/root/.local/share/pnpm/.tools/pnpm/9.6.0/node_modules/pnpm/dist/node_modules/node-gyp/lib/find-python.js:306:11).../node_modules/syscall-napi install: gyp ERR! stack at PythonFinder.findPython (/root/.local/share/pnpm/.tools/pnpm/9.6.0/node_modules/pnpm/dist/node_modules/node-gyp/lib/find-python.js:164:17).../node_modules/syscall-napi install: gyp ERR! stack at process.processTicksAndRejections (node:internal/process/task_queues:95:5).../node_modules/syscall-napi install: gyp ERR! stack at async configure (/root/.local/share/pnpm/.tools/pnpm/9.6.0/node_modules/pnpm/dist/node_modules/node-gyp/lib/configure.js:27:18).../node_modules/syscall-napi install: gyp ERR! stack at async run (/root/.local/share/pnpm/.tools/pnpm/9.6.0/node_modules/pnpm/dist/node_modules/node-gyp/bin/node-gyp.js:81:18).../node_modules/syscall-napi install: gyp ERR! System Linux 6.15.6-100.fc41.x86_64.../node_modules/syscall-napi install: gyp ERR! command "/usr/local/bin/node" "/root/.local/share/pnpm/.tools/pnpm/9.6.0/node_modules/pnpm/dist/node_modules/node-gyp/bin/node-gyp.js" "rebuild".../node_modules/syscall-napi install: gyp ERR! cwd /repo/node_modules/.pnpm/syscall-napi@0.0.6/node_modules/syscall-napi.../node_modules/syscall-napi install: gyp ERR! node -v v20.19.4.../node_modules/syscall-napi install: gyp ERR! node-gyp -v v10.1.0.../node_modules/syscall-napi install: gyp ERR! not ok .../node_modules/syscall-napi install: Failed.../esbuild@0.23.0/node_modules/esbuild postinstall: Done.../node_modules/ffmpeg-static install: DoneDone in 12.7sx--> ed0ee5878e85[1/2] STEP 6/7: WORKDIR /repo/web--> 182249447377[1/2] STEP 7/7: RUN pnpm --filter ./web run buildNo projects matched the filters in "/repo/web"--> 67865894c0df[2/2] STEP 1/8: FROM nginx:alpine[2/2] STEP 2/8: WORKDIR /usr/share/nginx/html--> 853747f64228[2/2] STEP 3/8: COPY --from=builder /repo/web/build .Error: building at STEP "COPY --from=builder /repo/web/build .": checking on sources under "/var/lib/containers/storage/overlay/de3259beb716e10913908719b723ce7667ad8d6a8c96861aa4e6f45282d464ff/merged": copier: stat: "/repo/web/build": no such file or directory

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@jo-chemla@hyperdefined@verncat

[8]ページ先頭

©2009-2025 Movatter.jp