I followed this guide: Fly.io
this my dockerfile :
FROM base
RUN mkdir /app
WORKDIR /app
ENV NODE_ENV=production
# Install Doppler
RUN (curl -Ls --tlsv1.2 --proto "=https" --retry 3 https://cli.doppler.com/install.sh || wget -t 3 -qO- https://cli.doppler.com/install.sh) | 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:
ode:internal/modules/cjs/loader:959
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.
uncvrd
October 12, 2022, 4:48am
2
well what is your Dockerfile base image? I’m using the instructions for Debian
when using a node:14
image and it works great
I use
FROM node:16-bullseye-slim as base
could you show me your configuration ?
uncvrd
October 12, 2022, 5:36am
4
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" 'https://packages.doppler.com/public/cli/gpg.DE2A7741A397C129.key' | apt-key add - && \
echo "deb https://packages.doppler.com/public/cli/deb/debian 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?
uncvrd
October 12, 2022, 12:47pm
7
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
uncvrd
October 12, 2022, 12:54pm
9
https://docs.doppler.com/docs/dockerfile#installation 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
uncvrd
October 12, 2022, 1:07pm
11
probably because of the base image you initially used