Skip to content

Commit

Permalink
bug-1871345: Set build arguments in docker-compose.yml.
Browse files Browse the repository at this point in the history
  • Loading branch information
smarnach committed Dec 21, 2023
1 parent bafa786 commit d2d1ef4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 17 deletions.
13 changes: 3 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@
include .env
export

# Set these in the environment to override them. This is helpful for
# development if you have file ownership problems because the user
# in the container doesn't match the user on your host.
USE_UID ?= 10001
USE_GID ?= 10001

DOCKER := $(shell which docker)
DC=${DOCKER} compose

Expand Down Expand Up @@ -45,8 +39,7 @@ slick.sh:

.PHONY: build
build: .env ## | Build docker images.
${DC} build --build-arg userid=${USE_UID} --build-arg groupid=${USE_GID} --progress plain base frontend
${DC} build --progress plain fakesentry ${SERVICES}
${DC} build --progress plain base frontend fakesentry ${SERVICES}
touch .docker-build

.PHONY: setup
Expand Down Expand Up @@ -97,8 +90,8 @@ testshell: .env .docker-build ## | Open shell in test environment.

.PHONY: docs
docs: .env .docker-build ## | Build docs.
${DC} run --rm --user ${USE_UID} --no-deps web bash make -C docs/ clean
${DC} run --rm --user ${USE_UID} --no-deps web bash make -C docs/ html
${DC} run --rm --no-deps web bash make -C docs/ clean
${DC} run --rm --no-deps web bash make -C docs/ html

.PHONY: lint
lint: .env .docker-build ## | Lint code.
Expand Down
19 changes: 12 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ services:
build:
context: .
dockerfile: docker/Dockerfile
args:
userid: ${USE_UID}
groupid: ${USE_GID}
image: tecken:build
env_file:
- docker/config/local_dev.env
Expand Down Expand Up @@ -70,10 +73,18 @@ services:
- redis-cache
command: web

frontend:
# Same as 'frontend' but no volumes or command
frontend-ci:
build:
context: .
dockerfile: frontend/Dockerfile
args:
userid: ${USE_UID}
groupid: ${USE_GID}

frontend:
extends:
frontend-ci
environment:
- NODE_ENV=development
ports:
Expand All @@ -83,12 +94,6 @@ services:
- $PWD/frontend:/app
command: start

# Same as 'frontend' but no volumes or command
frontend-ci:
build:
context: .
dockerfile: frontend/Dockerfile

# https://hub.docker.com/_/postgres/
db:
image: postgres:12.7
Expand Down

0 comments on commit d2d1ef4

Please sign in to comment.