Skip to content

Commit

Permalink
feat: Update compose networking strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
afifurrohman-id committed Dec 13, 2023
1 parent 5e9af8d commit 298cd66
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/live.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
# need add host.docker.internal:host-gateway,
# for Connect to emulator if using it
run: |
docker run --rm --name ${{github.event.repository.owner.login}} --add-host=host.docker.internal:host-gateway -e GOOGLE_CLOUD_STORAGE_SERVICE_ACCOUNT -e GOOGLE_CLOUD_STORAGE_BUCKET -e SERVER_URI -e GOOGLE_OAUTH2_REFRESH_TOKEN_TEST -e APP_ENV -e PORT -e GOOGLE_OAUTH2_CLIENT_ID_TEST -e GOOGLE_OAUTH2_CLIENT_SECRET_TEST ${{github.event.repository.name}} go test -v --cover -ldflags '-w -s' ./...
docker run --rm --name ${{github.event.repository.owner.login}} -e GOOGLE_CLOUD_STORAGE_SERVICE_ACCOUNT -e GOOGLE_CLOUD_STORAGE_BUCKET -e SERVER_URI -e GOOGLE_OAUTH2_REFRESH_TOKEN_TEST -e APP_ENV -e PORT -e GOOGLE_OAUTH2_CLIENT_ID_TEST -e GOOGLE_OAUTH2_CLIENT_SECRET_TEST ${{github.event.repository.name}} go test -v --cover -ldflags '-w -s' ./...
deploy:
needs: [ test ]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/preview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:

- name: Unit testing
run: |
docker run --rm --name ${{github.event.repository.owner.login}} --add-host=host.docker.internal:host-gateway -e GOOGLE_CLOUD_STORAGE_SERVICE_ACCOUNT -e GOOGLE_CLOUD_STORAGE_BUCKET -e SERVER_URI -e GOOGLE_CLOUD_STORAGE_EMULATOR_ENDPOINT -e GOOGLE_OAUTH2_REFRESH_TOKEN_TEST -e PORT -e GOOGLE_OAUTH2_CLIENT_ID_TEST -e GOOGLE_OAUTH2_CLIENT_SECRET_TEST ${{github.event.repository.name}} go test -v --cover -ldflags '-w -s' ./...
docker run --rm --name ${{github.event.repository.owner.login}} --network tempsy_net -e GOOGLE_CLOUD_STORAGE_SERVICE_ACCOUNT -e GOOGLE_CLOUD_STORAGE_BUCKET -e SERVER_URI -e GOOGLE_CLOUD_STORAGE_EMULATOR_ENDPOINT -e GOOGLE_OAUTH2_REFRESH_TOKEN_TEST -e PORT -e GOOGLE_OAUTH2_CLIENT_ID_TEST -e GOOGLE_OAUTH2_CLIENT_SECRET_TEST ${{github.event.repository.name}} go test -v --cover -ldflags '-w -s' ./...
- name: Clean up Services
if: always()
Expand Down
12 changes: 8 additions & 4 deletions deployments/compose.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
services:
firebase_emulators:
container_name: firebase_emulators
image: afifurrohman/tiny-firebase
networks:
- tempsy_net
ports:
- 4000:4000
- 9999:9999
Expand All @@ -10,9 +13,10 @@ services:
- tempsy_data:/root/.cache/firebase
- ../configs/firebase.json:/firebase/firebase.json
- ../configs/storage.rules:/firebase/storage.rules
# Needed for access public file when using emulator
extra_hosts:
- host.docker.internal:host-gateway

volumes:
tempsy_data:
tempsy_data:

networks:
tempsy_net:
name: tempsy_net

0 comments on commit 298cd66

Please sign in to comment.