Skip to content

Commit

Permalink
Add docker compose.
Browse files Browse the repository at this point in the history
There was a missing pids directory that was necessary for launching -
this docker-compose file let me debug that.
  • Loading branch information
tpendragon committed Sep 12, 2024
1 parent 60e7aff commit 95ba106
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 5 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ Run the `bin/rails server` or `rails s` command, then in a browser connect to [l

## Deploying

You may use Capistrano on the command line.
You can deploy from the command line:

`BRANCH=branch_name bundle exec cap staging deploy`
`BRANCH=branch_name ./bin/deploy staging`

`BRANCH=branch_name bundle exec cap production deploy`
## Testing Production Install

Alternatively, you may deploy from [ansible-tower](https://ansible-tower.princeton.edu/).
You can test the docker container by running `docker compose up` and going to `http://localhost:3000`

## How to load data

Expand Down
2 changes: 1 addition & 1 deletion bin/deploy
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ curl -s -X POST -H "Accept: application/vnd.github+json-H" -H "Content-Type: app

# Deploy using nomad-host-prod1, which has the nomad management key.
ssh [email protected] << EOF
curl -s "https://raw.githubusercontent.com/pulibrary/${REPOSITORY}/${BRANCH_NAME}/config/deploy/${ENV}.hcl" | nomad job run -var "branch_or_sha=sha-$(git ls-remote https://github.com/pulibrary/${REPOSITORY}.git ${BRANCH_NAME} | awk '{ print substr($1,1,7) }')" -
curl -H 'Cache-Control: no-cache' -s "https://raw.githubusercontent.com/pulibrary/${REPOSITORY}/${BRANCH_NAME}/config/deploy/${ENV}.hcl" | nomad job run -var "branch_or_sha=sha-$(git ls-remote https://github.com/pulibrary/${REPOSITORY}.git ${BRANCH_NAME} | awk '{ print substr($1,1,7) }')" -
EOF
retcode=$?

Expand Down
34 changes: 34 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
version: "3.8"
services:
web:
build:
context: .
args:
UID: ${UID:-1000}
GID: ${GID:-${UID:-1000}}
ports:
- "3000:3000"
environment:
- SECRET_KEY_BASE=1111111
- APP_DB_HOST=postgres-db
- APP_DB_USERNAME=root
- APP_DB_PASSWORD=password
- APP_DB=pulfalight
- RAILS_ENV=staging
depends_on:
postgres-db:
condition: service_healthy
postgres-db:
image: postgres
environment:
POSTGRES_USER: root
POSTGRES_PASSWORD: password
volumes:
- ./tmp/db:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: pg_isready
interval: 2s
timeout: 5s
retries: 30
Empty file added tmp/pids/.keep
Empty file.

0 comments on commit 95ba106

Please sign in to comment.