Skip to content

Commit

Permalink
Update bin (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
joel authored Feb 9, 2024
1 parent 9528ed2 commit b9d3177
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions bin/db.thor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@ def start
run("docker network create notes-bridge-docker-network", capture: true)
run("docker volume create notes-data-volume", capture: true)

# --publish 5432:5432 \

run(
<<~CMD.gsub(/\s+/, " ").strip,
docker run --rm --detach --name notes-db \
--publish 5432:5432 \
--env POSTGRES_HOST_AUTH_METHOD=trust \
--network notes-bridge-docker-network \
--env PGDATA=/var/lib/postgresql/data/pgdata \
-v notes-data-volume:/var/lib/postgresql/data:delegated \
--detach postgres:14.10
postgres:14.10
CMD
capture: true
)
Expand Down
6 changes: 3 additions & 3 deletions bin/web.thor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def self.exit_on_failure?
desc "build", "Builds the app"
def build
say "Building the app"
run("docker build -t notes .", capture: true)
run("docker build -t workanywhere/notes:latest .", capture: true)

run("docker network create notes-bridge-docker-network", capture: true)
end
Expand All @@ -26,7 +26,7 @@ def start
run(
<<~CMD.gsub(/\s+/, " ").strip,
docker run --rm --name notes-web \
--publish 3000:3000 \
--publish 4005:3000 \
--env POSTGRES_HOST_AUTH_METHOD=trust \
--env DATABASE_URL=postgres://postgres@notes-db:5432/notes_development \
--env RAILS_ENV=development \
Expand All @@ -39,7 +39,7 @@ def start
-v #{Dir.pwd}/config:/rails/config:delegated \
-v #{Dir.pwd}/lib:/rails/lib:delegated \
-v #{Dir.pwd}/db:/rails/db:delegated
notes:latest
workanywhere/notes:latest
CMD
capture: false
)
Expand Down

0 comments on commit b9d3177

Please sign in to comment.