I have the docker fauna DB installed locally, and I can use it on my local machine. The next step — how do I use the docker image to create a local database on a CI server (github actions)?
The github action is failing with
Error response from daemon: driver failed programming external connectivity on endpoint 84cff8ede7e64504903e1b52dd3c827e_faunafaunadb_90a848 (5bb7fcb1b3badd381810995a91c1bec9175e5b76d99ffb9b12b27b483ea9f170): Error starting userland proxy: listen tcp4 0.0.0.0:8084: bind: address already in use
Error: failed to start containers: 60101ab367fb9539b3175d887b7fa271f85d0df37aeab19e986cc53493b24784
Error: Docker start fail with exit code 1
Changing the ports used in the github action solved it. I guess those ports were being used by something else.
# .github/workflows/test.yml
name: test with vitest
on:
push:
branches: [ main, staging ]
pull_request:
branches: [ main, staging ]
jobs:
test:
runs-on: ubuntu-20.04
timeout-minutes: 5
services:
fauna:
image: fauna/faunadb
# this is the important bit
# use different ports,
# because the defaults are taken
ports:
- 8000:8443
- 8001:8084
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20.16
- name: npm install, build
run: |
npm ci
npm run build
npm run lint
env:
NODE_ENV: 'test'
CI: true
- name: Run tests
run: |
npm run test:ci