forked from Ruby-Starter-Kits/Docker-Rails-Template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.ci.yml
38 lines (35 loc) · 914 Bytes
/
docker-compose.ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
---
# This is used to run the test suite within CI without requiring extra services.
#
## Usage:
#
# docker-compose -f docker-compose.ci.yml build test
# docker-compose -f docker-compose.ci.yml run --rm test
version: '3'
x-ci-app: &ci-app
build:
context: .
dockerfile: Dockerfile
target: development
environment:
DATABASE_URL: postgres://postgres:postgres@postgres:5432/
RAILS_ENV: test
RACK_ENV: test
BUNDLE_PATH: /usr/src/app/vendor/bundle
entrypoint: ./bin/docker/entrypoints/wait-for-postgres.sh
volumes:
- .:/usr/src/app:cached
depends_on:
- postgres
services:
postgres:
image: postgres:13.2-alpine
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
restart: on-failure
logging:
driver: none
test:
<<: *ci-app
command: bash -c "./bin/setup && ./bin/rake assets:precompile && ./bin/bundle exec rspec"