Skip to content

Commit

Permalink
update compose and git workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Eflii committed Nov 19, 2024
1 parent d290e14 commit 59a69a0
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ jobs:
npm run build
- name: Start frontend
run: |
export COUCHDB_USER="TO_BE_CHANGED"
export COUCHDB_PASSWORD="TO_BE_CHANGED"
docker compose up --detach
- name: Wait for frontend
uses: docker://benel/wait-for-response:1
Expand Down
35 changes: 34 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,37 @@ services:
- ./frontend/dist:/usr/share/nginx/html:ro
- ./settings/nginx.conf:/etc/nginx/conf.d/default.conf:ro
ports:
- 80:80
- 80:80
backend:
image: couchdb:3
ports:
- 5984:5984
environment:
- COUCHDB_USER
- COUCHDB_PASSWORD

accessible_backend:
image: curlimages/curl
entrypoint: ["/bin/sh","-c"]
command:
- |
alias put="curl -X PUT -u '${COUCHDB_USER}:${COUCHDB_PASSWORD}'"
put backend:5984/_node/nonode@nohost/_config/chttpd/enable_cors --data '"true"'
put backend:5984/_node/nonode@nohost/_config/cors/origins --data '"*"'
put backend:5984/helios
put backend:5984/helios/_security --data '{"members":{"roles":[]},"admins":{"roles":["_admin"]}}'
depends_on:
backend:
condition: service_healthy

updated_samples:
image: curlimages/curl
entrypoint: ["/bin/sh","-c"]
volumes:
- ./frontend/public/sample_data.json:/sample_data.json
command:
- |
curl -X POST http://backend:5984/helios/_bulk_docs -H "Content-Type: application/json" -d @/sample_data.json
depends_on:
accessible_backend:
condition: service_completed_successfully

0 comments on commit 59a69a0

Please sign in to comment.