The advantage of containerization like Docker is that the container (nee image) is both the application and its operating environment.
However, since the container has its own operating environment,
I was looking for a relatively simple and portable method of handling secrets (i.e. confidential data like usernames and passwords) in my projects. Something that demonstrated the principles and practices of (good) secret management that was still useable locally, in Continuous Integration/Continuous Deployment (CI/CD),
As I mentioned on my failed attempt using Docker Secrets, I have been looking for a relatively simple and portable method of handling secrets (i.e. confidential data like usernames and passwords) in my personal projects. Something that demonstrated the principles
You can use GitHub Actions as your Continuous Integration (CI) / Continuous Deployment (CD) pipeline for your GitHub source code repositories.
This gives you the advantages of...
This is absolutely no substitute for true automated Continuous Integration (CI), but it is better than nothing and it is fairly simple and cheap if you are already building images. It is also a great illustration of how to use multi-stage builds
This model and approach is based on the belief that the (Docker) image of the application (and not the source code) should be the "source of truth" and object of the Continuous Integration / Continuous Deployment (CI/CD).
Key Points Covered...
# Dockerfile for a containerized development environment | |
# for the railstutorial.org Rails tutorial | |
# ASSUMPTION: source is volume mounted | |
# docker build --no-cache -t railsgen . | |
# docker run -it --rm -v $(pwd):/app -p 3000:3000 railsgen | |
# bundle exec bin/rails server -p 3000 -b 0.0.0.0 | |
FROM ruby:3.1.2-slim-bullseye | |
ARG BUNDLER_VER=2.3.14 | |
ARG RAILS_VER=7.0.4 |