This repository was archived by the owner on Jan 13, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.ci.yml
More file actions
50 lines (46 loc) · 1.25 KB
/
docker-compose.ci.yml
File metadata and controls
50 lines (46 loc) · 1.25 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
---
# 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
#
# Docker Compose 2.4 is for local development
# https://www.heroku.com/podcasts/codeish/57-discussing-docker-containers-and-kubernetes-with-a-docker-captain - Source on that.
version: '2.4'
x-ci-app: &ci-app
image: rails-app:0.3.0
mem_limit: 512m
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
volumes:
- .:/usr/src/app:cached
depends_on:
postgres:
condition: service_healthy
services:
postgres:
image: postgres:12.3-alpine
mem_limit: 64m
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
restart: on-failure
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
logging:
driver: none
test:
<<: *ci-app
command: bash -c "bin/setup && bundle exec rails db:test:load && bundle exec rake assets:precompile && bundle exec rspec"