Integrating with Docker
Inject variables into your container
Here is an example Dockerfile
FROM node:latest
COPY ./app ./app
RUN npm install -g secretsfoundry
WORKDIR app
ENTRYPOINT ["secretsfoundry", "run", "-s", "node example.js"]The base image in this example, already has node installed. This is required as
secretsfoundryis an npm package. In case, your base image is different, make sure to havenodeandnpminstalled in the image before proceeding to installsecretsfoundryOnce we get the image ready, we are ready to install
secretsfoundryon our container. To installsecretsfoundry, runnpm install -g secretsfoundryOnce that's done, we are ready to use
secretsfoundry. In the example above, we are calling a sample.jsfile which is loaded onto the container.
Once built and run, the container will run node example.js with the injected .env file values
Last updated
Was this helpful?