From b0553364320aad6520f5b6d13ce2a6eac77fb7f9 Mon Sep 17 00:00:00 2001 From: Dustin Pianalto Date: Thu, 30 Apr 2020 21:10:06 -0800 Subject: [PATCH] Add script to build and run on ec2 Remove postgres container because it is not used --- docker-compose.yml | 30 +++++++++++++++--------------- user-data.sh | 4 ++++ 2 files changed, 19 insertions(+), 15 deletions(-) create mode 100644 user-data.sh diff --git a/docker-compose.yml b/docker-compose.yml index 2569cc1..d087d18 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,27 +1,27 @@ version: "3" services: - goff-db: - image: postgres - ports: - - "5432:5432" - volumes: - - "${PWD}/postgres.conf:/etc/postgresql/postgresql.conf" - - "goff-db:/var/lib/postgresql/data:rw" - env_file: ${PWD}/.env +# goff-db: +# image: postgres +# ports: +# - "5432:5432" +# volumes: +# - "${PWD}/postgres.conf:/etc/postgresql/postgresql.conf" +# - "goff-db:/var/lib/postgresql/data:rw" +# env_file: ${PWD}/.env goff: build: context: . dockerfile: "${PWD}/Dockerfile" env_file: ${PWD}/.env - depends_on: - - goff-db +# depends_on: +# - goff-db environment: - DATABASE_URL=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}?sslmode=disable - links: - - goff-db:goff.db +# links: +# - goff-db:goff.db -volumes: - goff-db: - external: true \ No newline at end of file +#volumes: +# goff-db: +# external: true \ No newline at end of file diff --git a/user-data.sh b/user-data.sh new file mode 100644 index 0000000..ca4a059 --- /dev/null +++ b/user-data.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +/usr/local/bin/docker-compose build || exit +/usr/local/bin/docker-compose up \ No newline at end of file