Skip to content

Commit

Permalink
build updates (Docker)
Browse files Browse the repository at this point in the history
  • Loading branch information
amancevice committed Feb 6, 2025
1 parent 75f5ce2 commit 8450d71
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
*.zip

# ruby
.bundle/cache
vendor/
.rspec_status
*.json
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM public.ecr.aws/lambda/ruby
RUN dnf install -y gcc
ENV BUNDLE_SILENCE_ROOT_WARNING=1
VOLUME /root/.bundle
VOLUME /var/task
ENTRYPOINT ["bundle"]
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
GEMFILES ?= $(shell find . -name Gemfile -maxdepth 5 | sort)
LOCKFILES ?= $(foreach GEMFILE,$(GEMFILES),$(GEMFILE).lock)
GEMFILES ?= $(shell git ls-tree -r --name-only @ | grep Gemfile$)
LOCKFILES ?= $(shell git ls-tree -r --name-only @ | grep Gemfile.lock$)

.PHONY: blue build clean global logs

blue:
terraform -chdir=$@ apply

build: $(LOCKFILES)
docker compose down --rmi local

clean:
find . -type d -name vendor | xargs rm -rf
Expand All @@ -18,5 +19,5 @@ logs:
aws logs tail --follow $(shell aws logs describe-log-groups | jq -r '.logGroups[].logGroupName' | grep brutalismbot | fzf --no-info --reverse --sync --height 10%)

$(LOCKFILES): %.lock: % .ruby-version
BUNDLE_APP_CONFIG=$(PWD)/.bundle BUNDLE_GEMFILE=$< bundle update
BUNDLE_APP_CONFIG=$(PWD)/.bundle BUNDLE_GEMFILE=$< bundle install
BUNDLE=$(shell dirname $<) docker compose run --rm build update
BUNDLE=$(shell dirname $<) docker compose run --rm build install
7 changes: 7 additions & 0 deletions compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
services:
build:
build: .
volumes:
- ./.bundle:/root/.bundle
- ./${BUNDLE:-}:/var/task

0 comments on commit 8450d71

Please sign in to comment.