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

[Feature Request]: Docker config.json auto generate #48

Open
1 task done
soyelmismo opened this issue Apr 3, 2023 · 3 comments
Open
1 task done

[Feature Request]: Docker config.json auto generate #48

soyelmismo opened this issue Apr 3, 2023 · 3 comments

Comments

@soyelmismo
Copy link

soyelmismo commented Apr 3, 2023

Not a duplicate feature request

  • I have searched the existing issues and confirmed this feature request is not a duplicate.

Describe the feature

Please add something to auto generate the default.json file in a binded volume when the file doesn't exists, this is useful when you want to use the new file with new update features, and can save time by skipping the manual copy and paste from the repo

@soyelmismo
Copy link
Author

soyelmismo commented Apr 3, 2023

If I delete the previous generated file and update the container and try to run it gives this error because the file doesn't exists anymore


WARNING: To disable this warning set SUPPRESS_NO_CONFIG_WARNING in the environment.

Error: Configuration property "api.type" is not defined

    at Config.get (/app/node_modules/.pnpm/config@3.3.9/node_modules/config/lib/config.js:179:11)

    at loadConfig (file:///app/dist/utils.js:20:28)

    at main (file:///app/dist/index.js:7:18)

    at file:///app/dist/index.js:22:1

    at ModuleJob.run (node:internal/modules/esm/module_job:194:25)

 ELIFECYCLE  Command failed with exit code 1.```

@soyelmismo
Copy link
Author

So maybe environment variables can be added to auto generate a new file after an update specifying API type and token

@Vadko
Copy link
Collaborator

Vadko commented Apr 30, 2023

this probably is related to the Dockerfile config. Could you please try this dockerfile:

# Builder stage
FROM node:lts-alpine AS builder

RUN npm install -g pnpm

WORKDIR /app

COPY config /app/config
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile --ignore-scripts

COPY . .
RUN pnpm build


# Runner stage
FROM node:lts-alpine

RUN npm install -g pnpm

WORKDIR /app

COPY config /app/config
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile --ignore-scripts --prod --no-optional

COPY --from=builder /app/dist ./dist

CMD pnpm start

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants