Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker build - multiple errors - documentation #614

Open
shuther opened this issue Dec 7, 2023 · 4 comments · May be fixed by #1238
Open

Docker build - multiple errors - documentation #614

shuther opened this issue Dec 7, 2023 · 4 comments · May be fixed by #1238
Labels
support A request for help setting things up

Comments

@shuther
Copy link

shuther commented Dec 7, 2023

I can't find documentation to build it myself; so I tried:
docker-compose build up
But I got multiple errors amoung:

chat-ui/.env: line 23: unexpected character """ in variable name ""PROVIDER_URL": "","

Even source .env returned multiple errors; I tried to change the `into a ' with no luck.

My goal was to build it and include it into a docker compose.

@nsarrazin
Copy link
Collaborator

Try building it like this

docker build -t chat-ui .

and then run it with docker run not docker compose. docker compose will try to read the .env at the root of the repo but it's not supposed to 😅

@nsarrazin nsarrazin added the support A request for help setting things up label Dec 7, 2023
@shuther
Copy link
Author

shuther commented Dec 8, 2023

Still one error, let me know if I miss anything:

> [builder 3/3] RUN --mount=type=secret,id=DOTENV_LOCAL,dst=.env.local     npm run build:                                                                                                                  
1.140                                                                                                                                                                                                       
1.140 > [email protected] build                                                                                                                                                                                 
1.140 > vite build                                                                                                                                                                                          
1.140 
1.389 ▲ [WARNING] Cannot find base config file "./.svelte-kit/tsconfig.json" [tsconfig.json]
1.389 
1.389     tsconfig.json:2:12:
1.389       2 │   "extends": "./.svelte-kit/tsconfig.json",
1.389         ╵              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1.389 
3.214 
3.215 vite v4.3.9 building SSR bundle for production...
3.246 transforming...
6.070 ✓ 215 modules transformed.
6.071 ✓ built in 2.85s
6.071 "OPENID_CONFIG" is not exported by "virtual:$env/static/private", imported by "src/lib/server/auth.ts".
6.071 file: /app/src/lib/server/auth.ts:11:1
6.071  9:   OPENID_TOLERANCE,
6.071 10:   OPENID_RESOURCE,
6.071 11:   OPENID_CONFIG,
6.071       ^
6.071 12: } from "$env/static/private";
6.071 13: import { sha256 } from "$lib/utils/sha256";
6.073 error during build:
6.073 RollupError: "OPENID_CONFIG" is not exported by "virtual:$env/static/private", imported by "src/lib/server/auth.ts".
6.073     at error (file:///app/node_modules/rollup/dist/es/shared/node-entry.js:2125:30)
6.073     at Module.error (file:///app/node_modules/rollup/dist/es/shared/node-entry.js:13452:16)
6.073     at Module.traceVariable (file:///app/node_modules/rollup/dist/es/shared/node-entry.js:13863:29)
6.073     at ModuleScope.findVariable (file:///app/node_modules/rollup/dist/es/shared/node-entry.js:12418:39)
6.073     at Identifier.bind (file:///app/node_modules/rollup/dist/es/shared/node-entry.js:8116:40)
6.073     at CallExpression.bind (file:///app/node_modules/rollup/dist/es/shared/node-entry.js:5735:28)
6.073     at CallExpression.bind (file:///app/node_modules/rollup/dist/es/shared/node-entry.js:9669:15)
6.073     at CallExpression.bind (file:///app/node_modules/rollup/dist/es/shared/node-entry.js:5735:28)
6.073     at CallExpression.bind (file:///app/node_modules/rollup/dist/es/shared/node-entry.js:9669:15)
6.073     at VariableDeclarator.bind (file:///app/node_modules/rollup/dist/es/shared/node-entry.js:5739:23)
6.100 npm notice 
6.101 npm notice New patch version of npm available! 10.2.3 -> 10.2.5
6.101 npm notice Changelog: <https://github.com/npm/cli/releases/tag/v10.2.5>
6.101 npm notice Run `npm install -g [email protected]` to update!
6.101 npm notice 

@TomTom101
Copy link

"OPENID_CONFIG" is not exported . Add this and potentially all others to .env.local. The simplest docker-compose.yml that works for me is this (after removing .env):

version: '3.3'

services:
  mongodb:
    image: mongo:latest
    ports:
      - '27017:27017'
    restart: always

  huggingchat:
    build: 
      context: .
    ports:
      - '3000:3000'

@rodrigobdz
Copy link
Contributor

rodrigobdz commented Jun 1, 2024

The solution is to tell Docker Compose to skip reading .env, as explained here: docker/compose#6741 (comment)

docker compose --env-file /dev/null up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support A request for help setting things up
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants