Last active
July 12, 2017 00:59
-
-
Save ivanseidel/d1aa1687279df2a733ad42527c8635be to your computer and use it in GitHub Desktop.
startup-script.sh
This file contains 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 | |
echo User: $USER | |
/usr/share/google/dockercfg_update.sh | |
# Make sure container is stopped | |
docker stop tendaedu || true && /usr/bin/docker rm tendaedu || true | |
# Download ENV_LIST metadata and stores locally | |
curl "http://metadata.google.internal/computeMetadata/v1/project/attributes/ENV_LIST" -H "Metadata-Flavor: Google" -o list.env | |
# Pull image | |
docker pull gcr.io/tenda-edu-test/edu-backend:latest | |
# Execute image | |
docker run \ | |
--name=tendaedu \ | |
--log-driver=gcplogs \ | |
--env-file=./list.env \ | |
-p 80:80 \ | |
-p 443:443 \ | |
gcr.io/tenda-edu-test/edu-backend:latest yarn start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment