Skip to content

Instantly share code, notes, and snippets.

@JJetmar
Forked from jancurn/Dockerfile
Last active January 22, 2025 09:13
Show Gist options
  • Select an option

  • Save JJetmar/64de272426a71e3180c99be9ec93ba58 to your computer and use it in GitHub Desktop.

Select an option

Save JJetmar/64de272426a71e3180c99be9ec93ba58 to your computer and use it in GitHub Desktop.
Example of an Apify actor stored in a GitHub Gist.

This is an example of an Apify actor for exposing the Actor's and Run's secrets stored on Apify platform.

# Here you choose the base Docker image for the actor. Apify provides the following images:
# apify/actor-node-basic
# apify/actor-node-chrome
# apify/actor-node-puppeteer
# However, you can use any other image from Docker Hub.
# For more information, see https://apify.com/docs/actor#base-images
FROM apify/actor-node:20
# Copy all files and directories from the directory to the Docker image
COPY . ./
# Install NPM packages, skip optional and development dependencies to keep the image small,
# avoid logging to much and show log the dependency tree
RUN npm install --quiet --only=prod --no-optional \
&& npm list
# Define that start command
ENTRYPOINT [ "node", "secrets-exposer-actor" ]
{
"name": "secrets-exposer-actor",
"version": "0.0.1",
"private": true,
"dependencies": {
"apify": "^0.11.8"
}
}
const Apify = require('apify');
Apify.main(async () => {
// Expose Actor's Enviroment variables
await Apify.setValue('ENV_VAR', process.env);
await Apify.setValue('INPUT_EXPOSED', await Apify.getValue('INPUT'));
console.log(`Check KV-store!`);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment