forked from dbernheisel/oracle-testdb-ci-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sample-docker-compose.yml
56 lines (51 loc) · 1.84 KB
/
sample-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
---
version: '2'
services:
oracle:
image: your_private_registry:oracle-database-12.1.0.2-ee-testdb
expose:
- "1521" # Expose database listener to containers
ports:
- "5500:5500" # Oracle OEM Express
# Below is a sample setup for a Ruby/Rails app. May need to adjust to your needs.
app:
build: .
command: /bin/bash docker-start.sh # do nothing
volumes_from:
- bundler_cache
ports:
- "3000:3000" # Rails server
environment:
# needed for wait-for-db.sh
- ORACLE_PDB=ORCLPDB1
- ORACLE_PWD=test
- ORACLE_USER=test
- ORACLE_HOST=oracle
# Optional run bundle exec:
# - BUNDLE_EXEC="some command here"
links:
- oracle
bundler_cache:
image: yourapp_app # name of above image after docker-compose builds it
volumes:
- /bundle
command: /bin/bash docker-start.sh
# To run Oracle locally, perform these steps:
# `docker pull your_private_registry:oracle-database-12.1.0.2-ee-testdb`
# `docker run --name oracle12c-test -p 1521:1521 --rm -i -t your_private_registry:oracle12c-test-db`
#
# You should have Oracle ready at this point, and can either:
# 1) Run your app on your machine natively.
# 2) Run your app within Docker.
# I recommend #1. It's less complicated. #2 is mainly for CI testing.
# The test-db image does not persist data on your machine, so it's only suitable
# for running tests from clean slate.
# To run all of the images, perform these steps:
# 1) `docker-compose build app`. Make sure you have a build of the app service.
# This is because bundler will be based on the app image which needs to be
# present before itself can be built, and then volume-out the bundler cache.
# 2) `docker-compose up`
# 3) `docker-compose exec app your_command_here`
# Oracle users:
# sysdba | user: sys pass: oracle
# dba | user: test pass: test