Still failed to run doppler in to get the env

I followed this guide:

this my dockerfile :

FROM base

RUN mkdir /app

ENV NODE_ENV=production

# Install Doppler
RUN (curl -Ls --tlsv1.2 --proto "=https" --retry 3 || wget -t 3 -qO- | sh

COPY --from=production-deps /app/node_modules /app/node_modules

COPY --from=build /app/build /app/build
COPY --from=build /app/public /app/public
ADD . .

CMD ["doppler", "run", "--", "yarn", "run", "start"]

I get this error:

2022-10-11T10:12:54Z   [info]  throw err;
2022-10-11T10:12:54Z   [info]  ^
2022-10-11T10:12:54Z   [info]Error: Cannot find module '/app/doppler'
2022-10-11T10:12:54Z   [info]    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:956:15)
2022-10-11T10:12:54Z   [info]    at Function.Module._load (node:internal/modules/cjs/loader:804:27)
2022-10-11T10:12:54Z   [info]    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
2022-10-11T10:12:54Z   [info]    at node:internal/main/run_main_module:17:47 {
2022-10-11T10:12:54Z   [info]  code: 'MODULE_NOT_FOUND',
2022-10-11T10:12:54Z   [info]  requireStack: []

I have no idea to fix it.

well what is your Dockerfile base image? I’m using the instructions for Debian when using a node:14 image and it works great :slight_smile:

I use

FROM node:16-bullseye-slim as base

could you show me your configuration ?

That’s probs why -

# ------------> Base Image
FROM node:14 AS base

# Install Doppler CLI
RUN apt-get update && apt-get install -y apt-transport-https ca-certificates curl gnupg && \
    curl -sLf --retry 3 --tlsv1.2 --proto "=https" '' | apt-key add - && \
    echo "deb any-version main" | tee /etc/apt/sources.list.d/doppler-cli.list && \
    apt-get update && \
    apt-get -y install doppler

Then I use the same CMD as you

The cURL command probably isnt installing the binary where you expect it to be

wow, it works for me as well, but what is the means with

ca-certificates and gpg.DE2A7741A397C129.key'

could you explain a bit about the command for installing doppler?

cool glad it works! and you can ask on the doppler forum, this is the command they provide in their documentation, maybe they can provide more insight on the necessary dependencies

could you send the documentation link? I still didn’t see it in the documentation it’s the ubuntu/debian tab instead of the shell tab you got your code from

oh, I see, in the Debian menu, I use the shell script before, and it does not work hmmm… but I’m not sure why

probably because of the base image you initially used