Skip to content

Commit

Permalink
chore: production make target
Browse files Browse the repository at this point in the history
  • Loading branch information
EduardoSimon committed Mar 31, 2024
1 parent 22ef0cf commit e86fc44
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 9 deletions.
5 changes: 4 additions & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
OB_CLIENT_ID=test-id
OB_CLIENT_SECRET=s3cret
OB_CLIENT_SECRET=s3cret
DATABASE_URL=postgres://postgres:password@db:5432
RAILS_ENV=development
RAILS_LOG_TO_STDOUT=true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@

# Ignore any coverage file
coverage
postgres-data
14 changes: 11 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ shell-test:
$(DOCKER_BIN) exec -it -e RAILS_ENV=test web /bin/bash

.PHONY: rails-console
rails-console: up
rails-console:
$(DOCKER_BIN) exec web rails c

.PHONY: ruby-prepare
Expand Down Expand Up @@ -90,5 +90,13 @@ ruby-lint:

.PHONY: pg-shell
pg-shell:
$(DOCKER_BIN) up --build -d
$(DOCKER_BIN) exec -it db psql -U postgres
$(DOCKER_BIN) exec -it db psql -U postgres -d budget-io-dev --

.PHONY: pg-bash
pg-bash:
$(DOCKER_BIN) exec -it db /bin/bash --

.PHONY: up-production
up-production:
$(DOCKER_BIN) --env-file ./.env.production.local up --build

1 change: 1 addition & 0 deletions bootstrap_entrypoint
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#! /bin/sh
echo "Running bootstrapping in environment: ${RAILS_ENV}"
bundle exec rake assets:precompile
bundle exec rails db:prepare
exec $@
2 changes: 1 addition & 1 deletion config/credentials.yml.enc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sMn45mbBvrh2JtES95S+Dw6251+fUZey8HWawzg32XDL6KnCQLyLqQOsEq3BGVOCOvonajhfs57VCwOG9mEMk7jlvSMTJkwY1JK3HVRvHWWquSnkoyzZgzJb6B8CPe/ukh/Hnv2RifoKWH91zCSXawZWZpkMLlG9olRzMRqENcfdnaJuZFsOo34EWb9uVh43PcMppKgxLS2LyQELp4UjC9+Mr2etkC2+QX6m+5wrXwr88G/FUF0GTk7WEExNXDYtbThqwupoPrWtYWmqINIP54VoMc5pOhQiRtUuhLeIYrkegBuk9js99W76FyJcZxgN5FIm/hBgojy+jsjA/P4YsDrwe+1/8KSSYsqa1PaKAyI6ROKBezod6y+iRdM3zwezB9Q1s6JwgFH0UsqAJVxe8iDzxYpyB/AG8RI8--ELPEFwJVenHtvU0y--Ht7beT/i4gQSEhfK29Gv1A==
dHaOS51XOpENIpevt8F9s2+hej9+kdqhY9I34xgwXsgHqNEnNwLibKarMSm8wxaBYTm4HzfZx1qGC1jNCg8wdTlcrTmb5n29CxgDQ1GxjWzwz2VU7lt8VyCaj18p5c6jGX5DQ5iCj9qzlYxNH7EOizgwoD4sGNipV/6xYKyRFBYxVOAY6PB+9ipmOb0YdciFO+naN9Omgs3aq/M2c+QKZDVRkrZRJAPAN2E7+FB8YpwNLMIYj38ckbvVOfHiDZnjUyCIvdl9mAErW4bkXNr+uroBB68FO5GCGzsg+dQybNpHBsxc8o8dE0X2DdVwN589fxda0txztxns9L4Oxl78LKnEJ3mbHBaze3SH0BWb/vahQIs20DIqzZAs3QgYG10f1I9SE7R80uWyrzlfe6PuLbIS7iAw--uRwexVHqqbFZySAI--PIi4Ib5b43qdcROgnhu+lQ==
16 changes: 12 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ services:
ports:
- "3000:3000"
environment:
- RAILS_ENV=development
- DATABASE_URL=postgres://postgres:password@db:5432
- DATABASE_URL
- RAILS_ENV
- OB_CLIENT_ID
- OB_CLIENT_SECRET
depends_on:
db:
condition: service_healthy
Expand All @@ -27,14 +29,20 @@ services:
interval: 10s
timeout: 5s
retries: 5
volumes:
- .:/usr/src/app
- ./postgres-data:/var/lib/postgresql/data

bootstrap:
build:
context: .
volumes:
- .:/app
environment:
- RAILS_ENV=development
- DATABASE_URL=postgres://postgres:password@db:5432
- DATABASE_URL
- RAILS_ENV
- OB_CLIENT_ID
- OB_CLIENT_SECRET
depends_on:
db:
condition: service_healthy
Expand Down

0 comments on commit e86fc44

Please sign in to comment.