Skip to content

Commit

Permalink
test: docker compose e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
Toto-hitori committed Apr 30, 2024
1 parent d8520bc commit f13ea89
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- run: openssl pkcs12 -export -out server.p12 -inkey server.key -in server.crt -passout pass:${{ secrets.E2E_SSL_PASSWORD }}
- run: sudo mkdir /certs
- run: sudo mv server.p12 /certs/keystore.p12
- run: docker compose --profile e2e up -d --pull always
- run: docker compose -f ./webapp/e2e/docker-compose.yml up -d --pull always
- run: npm --prefix webapp install
- run: npm --prefix webapp run build
- run: npm --prefix webapp run test:e2e
76 changes: 76 additions & 0 deletions webapp/e2e/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
version: '3'
services:
WIQ_DB:
container_name: postgresql-${teamname:-defaultASW}
environment:
POSTGRES_USER: ${DATABASE_USER}
POSTGRES_PASSWORD: ${DATABASE_PASSWORD}
volumes:
- postgres_data:/var/lib/postgresql/data
image: postgres:latest
profiles: ["dev", "prod","e2e"]
networks:
mynetwork:

api:
container_name: api-${teamname:-defaultASW}
build:
context: ./api
args:
DATABASE_USER: ${DATABASE_USER}
DATABASE_PASSWORD: ${DATABASE_PASSWORD}
JWT_SECRET: ${JWT_SECRET}
SSL_PASSWORD: ${SSL_PASSWORD}
dockerfile: Dockerfile
environment:
- DATABASE_URL=jdbc:postgresql://WIQ_DB:5432/wiq
- DATABASE_USER=${DATABASE_USER}
- DATABASE_PASSWORD=${DATABASE_PASSWORD}
- JWT_SECRET=${JWT_SECRET}
- SSL_PASSWORD=${SSL_PASSWORD}
ports:
- 8443:8443
networks:
mynetwork:
volumes:
- /certs:/etc/letsencrypt/live/kiwiq.run.place:ro
depends_on:
- WIQ_DB
- kiwiq

question-generator:
container_name: question-generator-${teamname:-defaultASW}
build:
context: ./questiongenerator
args:
DATABASE_USER: ${DATABASE_USER}
DATABASE_PASSWORD: ${DATABASE_PASSWORD}
dockerfile: Dockerfile
environment:
- DATABASE_URL=jdbc:postgresql://WIQ_DB:5432/wiq
- DATABASE_USER=${DATABASE_USER}
- DATABASE_PASSWORD=${DATABASE_PASSWORD}
networks:
mynetwork:
depends_on:
- WIQ_DB

webapp:
container_name: webapp-${teamname:-defaultASW}
build:
args:
REACT_APP_API_ENDPOINT: ${API_URI}
context: ./webapp
dockerfile: Dockerfile
environment:
- REACT_APP_API_ENDPOINT=${API_URI}
networks:
mynetwork:

volumes:
postgres_data:
certs:

networks:
mynetwork:
driver: bridge

0 comments on commit f13ea89

Please sign in to comment.