Skip to content

Instantly share code, notes, and snippets.

@jkinkead
Last active May 18, 2024 14:57
Show Gist options
  • Save jkinkead/55db75d57df756c6d66b4c3f395df521 to your computer and use it in GitHub Desktop.
Save jkinkead/55db75d57df756c6d66b4c3f395df521 to your computer and use it in GitHub Desktop.
Simple .dockerignore file for a create-react-app application
# Items that don't need to be in a Docker image.
# Anything not used by the build system should go here.
Dockerfile
.dockerignore
.gitignore
README.md
# Artifacts that will be built during image creation.
# This should contain all files created during `npm run build`.
build
node_modules
@MNF
Copy link

MNF commented Jun 12, 2021

Should the name of file be .dockerignore?

@jkinkead
Copy link
Author

Yes, fixed. :)

@EdgarGC123
Copy link

shouldn't we also include node_modules as well considering docker should have a cmd for npm install?

@alfredorico
Copy link

should we also exclude .git folder?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment