From fc87e9abd02c8c523299363f5d50fe786562079e Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Sun, 24 Oct 2021 02:42:55 +0100 Subject: [PATCH] build: try building and pushing with Compose --- docker-compose-production.yaml | 6 +++++- run | 11 ++--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/docker-compose-production.yaml b/docker-compose-production.yaml index 38b780ce..dd3a2bfe 100644 --- a/docker-compose-production.yaml +++ b/docker-compose-production.yaml @@ -2,7 +2,11 @@ version: '2.4' services: web: - image: ghcr.io/opdavies/oliverdavies-uk-web + build: + context: . + dockerfile: tools/docker/images/Dockerfile + target: production + image: "ghcr.io/opdavies/oliverdavies-uk-web:${DOCKER_TAG:-latest}" ports: - 80:8080 restart: unless-stopped diff --git a/run b/run index b043b64a..30e260b5 100755 --- a/run +++ b/run @@ -4,8 +4,6 @@ set -e . .env -DOCKER_WEB_IMAGE_NAME="ghcr.io/opdavies/${COMPOSE_PROJECT_NAME}-web" - TTY="" if [[ ! -t 1 ]]; then TTY="-T" @@ -21,16 +19,11 @@ function deploy { } function docker:build-images { - docker image build . \ - --file tools/docker/images/Dockerfile \ - --tag ${DOCKER_WEB_IMAGE_NAME}:${DOCKER_TAG} \ - --tag ${DOCKER_WEB_IMAGE_NAME}:latest \ - --target=production + docker-compose build --file docker-compose-production.yaml } function docker:push-images { - docker image push ${DOCKER_WEB_IMAGE_NAME}:${DOCKER_TAG} - docker image push ${DOCKER_WEB_IMAGE_NAME}:latest + docker-compose push --file docker-compose-production.yaml } function help {