-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Containerize Kukkee #86
Comments
Since I spent a little bit of time containerizing the application I thought I'd share the Dockerfile I created here. I know there are further steps required to build and publish the image on Docker Hub but it's a start! FROM node:16-alpine
EXPOSE 3000
WORKDIR /app
COPY package.json package-lock.json /app/
RUN npm install
# Use a .dockerignore to skip copying node_modules
COPY . /app/
RUN npm run build
CMD npm run start I also pair it with a .dockerignore file for anyone building it locally so that their local node_modules and .env files aren't included in the built image. node_modules/
.env* |
Thank you @jadlers! I'm quite new to Docker-izing applications so this is quite helpful. We'll have an image on Docker Hub soon! |
Also, looking forward to hearing any feedback on how we can improve Kukkee! : ) |
When it comes to containers some of the main tenets of containerization are; as ephemeral as possible, containing no state, easily replaceable, and finally one process per container. As ephemeral as possible: meaning containers themselves should contain no state and be configured on boot through means of docker secrets for credentials and environment variables for configuration settings. Containing no state: an expansion on ephemerality effectively you should keep all of the persistent application data, user data, uploaded media, databases, etc... within a volume outside of the container be it in a bind mount on the host filesystem or in a docker volume. Easily replaceable: make it so that the app checks to see if its configured on boot and if it has all of its data and configurations do nothing but boot the application normally. One process per container: One of the main benefits of containers is application isolation meaning that every application running in containers should be granted the least possible access to additional software and system features. This means that most container based applications are communicating with one another either using sockets or network interfaces. A really great way to ensure that you're producing a useful Docker container is that you can supply the end users with a You can add a .gitignore for the pattern Also you can add a .dockerignore (similar to .gitignore but for docker's container build process) for ignoring uncompiled source code so that doesn't get scanned on container build every single time you build a container. If you follow most of these it should give you a healthy baseline for understanding how to publish a really great dockerized app. |
Containerize Kukkee
The text was updated successfully, but these errors were encountered: