Docker build - Just for fun (#203)

* Adding files to run in docker

* Updating build and run scripts with usage

* Updating build and run scripts to check for docker

* Fixing commented code

* Added docker compose file and added instructions
This commit is contained in:
Cory Sayles
2024-08-05 03:54:32 -04:00
committed by GitHub
parent 586205e678
commit 3edd9bd1ca
6 changed files with 131 additions and 0 deletions

24
docker-compose.yaml Normal file
View File

@@ -0,0 +1,24 @@
# HOW TO BUILD & RUN THE POTATO IMAGE
# 1. Run the potato-build.sh script and pass in an optional tag for the container
# e.g. ./potato-build.sh 1.0.0
# 1a. Run the potato-run.sh script and pass in an optional prepare type argument
# e.g. ./potato-run.sh "--vegan"
# 2. You can run using docker compose run
# e.g. docker compose run --build potato (Builds image before running)
# e.g. docker compose run potato (if you already built it)
# e.g. docker compose run potato --rm (removes the container upon exit)
# 2a. To pass in an argument, either edit the .env file,
# or set a local environment variable: e.g. export VEGAN="--vegan"
# 3. You can run using docker compose up.
# e.g. docker compose up
# 3a. Make sure to clean up containers since compose up doesn't have a --rm option
# e.g. docker container rm potato-potato-1
services:
potato:
build:
context: .
dockerfile: ./Dockerfile.spud
environment:
- VEGAN=${VEGAN}