build: try building and pushing with Compose
This commit is contained in:
parent
6a3f3eaa99
commit
fc87e9abd0
|
@ -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
|
||||
|
|
11
run
11
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 {
|
||||
|
|
Loading…
Reference in a new issue