write docker-compose from a docker file
Budget: $10 – $30 USD
Need to write a docker-composer to replace the following file.
# Prompt
while true; do
echo "This will kill the existing container (if it exists) and create a new one."
read -p "Proceed? [y/n]: " yn
case $yn in
[Yy]* ) break;;
[Nn]* ) exit;;
* ) echo "Please answer 'y' or 'n'.";;
esac
done
# Pull latest
docker pull us.gcr.io/spectrum-tracking/web-app:latest
# Stop container
docker kill web-app
# Remove the container so we can re-use the name
docker rm web-app
# Run the container with latest version
docker run \
--name web-app \
--restart=always \
-d \
-p 37000:80 \
-e VIRTUAL_HOST=app.spectrumtracking.com \
-e ENV_CONFIG="production" \
us.gcr.io/spectrum-tracking/web-app:latest
~
also need to limit docker size with
logging:
driver: "json-file"
options:
max-file: "5" # number of files or file count
max-size: "10m" # file size
# Prompt
while true; do
echo "This will kill the existing container (if it exists) and create a new one."
read -p "Proceed? [y/n]: " yn
case $yn in
[Yy]* ) break;;
[Nn]* ) exit;;
* ) echo "Please answer 'y' or 'n'.";;
esac
done
# Pull latest
docker pull us.gcr.io/spectrum-tracking/web-app:latest
# Stop container
docker kill web-app
# Remove the container so we can re-use the name
docker rm web-app
# Run the container with latest version
docker run \
--name web-app \
--restart=always \
-d \
-p 37000:80 \
-e VIRTUAL_HOST=app.spectrumtracking.com \
-e ENV_CONFIG="production" \
us.gcr.io/spectrum-tracking/web-app:latest
~
also need to limit docker size with
logging:
driver: "json-file"
options:
max-file: "5" # number of files or file count
max-size: "10m" # file size