forked from PlugaDotCo/nfe_io-ruby
-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
65 lines (60 loc) · 1.66 KB
/
Copy pathdocker-compose.yml
File metadata and controls
65 lines (60 loc) · 1.66 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Docker-based dev environment for the NFE.io Ruby SDK.
#
# Quick start:
# cp .env.docker.example .env # one-time, sets UID/GID
# docker compose build ruby34 # build the default (Ruby 3.4) image
# docker compose run --rm ruby34 bundle install
# docker compose run --rm ruby34 bundle exec rake # spec + rubocop + steep + rbs
#
# Reproduce the CI matrix locally:
# docker compose run --rm ruby32 bundle exec rake
# docker compose run --rm ruby33 bundle exec rake
# docker compose run --rm ruby34 bundle exec rake
#
# ruby34 (matches .ruby-version) is the primary dev service; 3.2 is the floor.
x-ruby-defaults: &ruby-defaults
volumes:
- .:/app
- bundle-cache:/home/app/bundle
working_dir: /app
init: true
tty: true
# Forward .env into the container so SDK env vars (NFE_API_KEY, NFE_DATA_API_KEY,
# etc.) are available to scripts running inside the container.
env_file:
- path: .env
required: false
services:
ruby32:
<<: *ruby-defaults
build:
context: .
dockerfile: docker/Dockerfile
args:
RUBY_VERSION: "3.2"
UID: "${UID:-1000}"
GID: "${GID:-1000}"
image: nfe-client-ruby:3.2
ruby33:
<<: *ruby-defaults
build:
context: .
dockerfile: docker/Dockerfile
args:
RUBY_VERSION: "3.3"
UID: "${UID:-1000}"
GID: "${GID:-1000}"
image: nfe-client-ruby:3.3
ruby34:
<<: *ruby-defaults
build:
context: .
dockerfile: docker/Dockerfile
args:
RUBY_VERSION: "3.4"
UID: "${UID:-1000}"
GID: "${GID:-1000}"
image: nfe-client-ruby:3.4
volumes:
bundle-cache:
driver: local