-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
74 lines (68 loc) · 2.37 KB
/
docker-compose.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
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
66
67
68
69
70
71
72
73
74
version: '3.7'
x-common-env:
&common-env
# The account and role to assume role to for looking up iam users and groups
BASTION_ACCOUNT: "${BASTION_ACCOUNT:-123456789012}"
BASTION_ROLE: "${BASTION_ROLE:-bastion-ssh}"
# The IAM group to which users will belong to grant them permission to ssh into the bastion
BASTION_SSH_GROUPS: "${BASTION_SSH_GROUPS:-admin user}"
# The IAM group to which users will belong to grant them permission to sudo on the bastion
BASTION_SUDO_GROUPS: "${BASTION_SUDO_GROUPS:-admin}"
# The pattern to use for converting between iam and system username, e.g. <user>@mydomain.com
BASTION_IAM_USER_PATTERN: "${BASTION_IAM_USER_PATTERN:-[user]@mydomain.com}"
# Causes creation of all users on container start, otherwise they will get created
# on first connect, but will have to connect twice - sshd doesn't seem to
# allow login in the same request as the system user is created
BASTION_FRONTLOAD_USERS: "${BASTION_FRONTLOAD_USERS:-false}"
# Pass through aws environment for dev/testing, and to make it easier to test
# against real aws
AWS_REGION: "${AWS_REGION:-local}"
AWS_DEFAULT_REGION: "${AWS_DEFAULT_REGION:-local}"
AWS_ACCESS_KEY_ID: "${AWS_ACCESS_KEY_ID:-testing}"
AWS_SECRET_ACCESS_KEY: "${AWS_SECRET_ACCESS_KEY:-testing}"
AWS_SECURITY_TOKEN: "${AWS_SECURITY_TOKEN:-testing}"
AWS_SESSION_TOKEN: "${AWS_SESSION_TOKEN:-testing}"
AWS_ENDPOINT_URL: "${AWS_ENDPOINT_URL:-http://moto:5000}"
services:
bastion:
build:
context: .
dockerfile: Dockerfile
target: production
command: "sshd"
environment:
<<: *common-env
SVC_ENV: 'development'
SVC_PORT: '2222'
volumes:
- .:/srv/app
ports:
- "2222:2222"
depends_on:
- moto
# Runs ruby tests as well as integration tests that use a ssh client to
# connect to the bastion container
dev:
build:
context: .
dockerfile: Dockerfile
target: development
command: "exec tail -f /dev/null" # Keeps container running for rubymine exec mode
environment:
<<: *common-env
BASTION_HOST: 'bastion'
BASTION_PORT: '2222'
volumes:
- .:/srv/app
depends_on:
- moto
- bastion
# for pry
# stdin_open: true
# tty: true
moto:
# waiting for updated docker build:
# image: motoserver/moto
image: cloudtruth/moto
ports:
- "5000:5000"