Last active
November 24, 2018 14:43
-
-
Save danielalvarenga/21f361116aae66ea782bc433cd85dcf7 to your computer and use it in GitHub Desktop.
Script inicial para iniciar aplicações rails com docker compose
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
args="'$*'" | |
containerRepositoryName='container_name_setted_in_docker_compose_service_web' | |
docker-compose down | |
# Create container application image with "latest" tag, set "Dockerfile" path, | |
# change "rails_env_var" variable inside Dockerfile and context path | |
if [[ "$args" =~ "--prod" ]]; then | |
docker build -t $containerRepositoryName:latest . | |
else | |
docker build -t $containerRepositoryName:latest --build-arg bundle_options_var='--without staging production' . | |
fi | |
# Execute docker compose to start services described in "docker-compose.yml" | |
# Adding "-d" hide logs. To show logs execute "docker-compose logs" | |
docker-compose up |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment