-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add 'docker-compose' file #1163
Changes from all commits
4a27ebd
b7d5afa
8b38684
0c85efc
b6e6dca
93b4d00
d1897fd
a1fe738
5324b1c
866679b
1e52558
8565afb
0e4a95a
c8bb71e
4f10ba4
c7b6c35
9462586
4a5fc13
59de52b
649af9a
1b8a9ef
212593a
1787049
8c62207
ee4c415
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# DAEMON_GROUP_ID=1420 # Match your docker group ID for permissions | ||
# IMS_SERVER_PORT=8080 | ||
# DOCKER_RANGERS_NETWORK=rangers | ||
# IMS_DB_IMAGE=mariadb:10.5.24 | ||
# IMS_DB_HOST_NAME=ranger_ims_database | ||
# IMS_DB_DATABASE=ims | ||
# IMS_DB_PASSWORD=7B33108D-4CD4-41B5-A244-B16F97038860 | ||
# IMS_DB_ROOT_PASSWORD=% | ||
# IMS_DB_ROOT_PASSWORD=ims-root |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/.docker | ||
/.hypothesis | ||
/.tox | ||
/build/ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,6 @@ | |
/htmldocs/ | ||
/src/*.egg-info/ | ||
__pycache__/ | ||
*.env | ||
/.docker/* | ||
!/.docker/sample.env | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,6 +41,26 @@ To run all of the default test environments:: | |
Running the Server | ||
~~~~~~~~~~~~~~~~~~ | ||
|
||
-------------------- | ||
With docker-compose | ||
-------------------- | ||
|
||
Run:: | ||
|
||
# First time setup; these files are mounted into the container | ||
cp conf/imsd-docker-compose-sample.conf conf/imsd.conf | ||
cp conf/directory-sample.yaml conf/directory.yaml | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we are starting MySQL up we probably should also use that for the directory, but it would be a pain to set up from scratch. We need a pair of dump files to add in this process: one for a starting directory and another for a IMS DB with something to fiddle with. I guess that could be a follow-on PR; no need to block here. |
||
|
||
If you need to override any of the environment variables set in | ||
`docker-compose.yml`, copy `.docker/sample.env` to `/.env` and | ||
uncomment and edit the neccessary variables. | ||
|
||
docker compose up | ||
|
||
------------------ | ||
Outside docker | ||
------------------ | ||
|
||
To run the server will require some configuration, and if you try to start the server with the default configuration, you will probably see an error such as this:: | ||
|
||
2020-03-12T09:16:55-0700 [ims.run._command.Command#info] Setting up web service at http://localhost:80/ | ||
|
@@ -58,6 +78,11 @@ To build and run the server (for development only):: | |
|
||
tox run -e exec | ||
|
||
|
||
--------------------- | ||
Settings Permissions | ||
--------------------- | ||
|
||
In your browser, open http://localhost:8080/ to reach the server. Log in as any user in the ``conf/directory.yaml`` directory file. In the ``conf/imsd.conf`` sample configuration file, the users ``Hardware`` and ``Loosy`` are administrators, and in the sample directory, all users have passwords that match their handles. You'll want to log in as one of those to set up an Event. | ||
|
||
Use the pull-down menu at the top right corner of the page (it will show the logged in user's Ranger handle), and select ``Admin``. On the next page, navigate to the Events page and create an event called ``Test``. | ||
|
@@ -66,6 +91,7 @@ In the box labeled ``Access for Test (writers)``, enter the string ``*``. That | |
|
||
You should now be able to select your new event from the ``Event`` menu at the top right, and then create new incidents within that event. | ||
|
||
|
||
Pull Requests | ||
~~~~~~~~~~~~~ | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
[Core] | ||
|
||
# Absolute or relative to parent of parent of this file | ||
ServerRoot = . | ||
|
||
DataStore = MySQL | ||
Directory = File | ||
|
||
# Absolute or relative to ServerRoot | ||
ConfigRoot = conf | ||
DataRoot = data | ||
CachedResources = cache | ||
|
||
# Bind address | ||
Host = localhost | ||
Port = 8080 | ||
|
||
Admins = Hardware, Loosy | ||
|
||
#MasterKey = 6C21E8C9-8B83-4EA3-93BD-6C6EFE8A712B | ||
|
||
#JWTSecret = DD264110-3A97-4348-9473-6D50B582550C | ||
|
||
RequireActive = True | ||
|
||
|
||
[Store:SQLite] | ||
|
||
# Relative to DataRoot | ||
File = db.sqlite | ||
|
||
|
||
[Store:MySQL] | ||
|
||
HostName = mysql | ||
HostPort = 3306 | ||
|
||
Database = ims | ||
UserName = ims | ||
Password = ims | ||
|
||
|
||
[Directory:File] | ||
|
||
# Relative to ConfigRoot | ||
File = directory.yaml | ||
|
||
|
||
[Directory:ClubhouseDB] | ||
|
||
Hostname = dms.rangers.example.com | ||
HostPort = 3306 | ||
|
||
Database = rangers | ||
Username = ims | ||
Password = 9F29BB2B-E775-489C-9C20-9FE3EFEE1F22 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
services: | ||
app: | ||
build: . | ||
container_name: ranger_ims_server | ||
user: :${DAEMON_GROUP_ID:-1420} | ||
environment: | ||
toddgardner marked this conversation as resolved.
Show resolved
Hide resolved
|
||
IMS_DIRECTORY: "${IMS_DIRECTORY:-File}" | ||
IMS_DIRECTORY_FILE: "${IMS_DIRECTORY_FILE:-/opt/ims/conf/directory.yaml}" | ||
IMS_DB_HOST_NAME: "${IMS_DB_HOST_NAME:-ranger_ims_database}" | ||
IMS_DB_DATABASE: "${IMS_DB_DATABASE:-ims}" | ||
IMS_DB_USER_NAME: "${IMS_DB_USER_NAME:-ims}" | ||
IMS_DB_PASSWORD: "${IMS_DB_PASSWORD:-ims}" | ||
volumes: | ||
- ./conf:/opt/ims/conf | ||
- ./:/srv/ims | ||
ports: | ||
- ${IMS_SERVER_PORT:-8080}:8080 | ||
depends_on: | ||
database: | ||
condition: service_healthy | ||
command: | ||
- /opt/ims/bin/ims | ||
- "--log-file" | ||
- "-" | ||
- "--config" | ||
- "/opt/ims/conf/imsd.conf" | ||
- server | ||
|
||
database: | ||
image: "${IMS_DB_IMAGE:-mariadb:10.5.24}" | ||
container_name: ranger_ims_database | ||
environment: | ||
MARIADB_DATABASE: "${IMS_DB_DATABASE:-ims}" | ||
MARIADB_USER: "${IMS_DB_USER_NAME:-ims}" | ||
MARIADB_PASSWORD: "${IMS_DB_PASSWORD:-ims}" | ||
MARIADB_ROOT_HOST: "${IMS_DB_ROOT_HOST:-%}" | ||
MARIADB_ROOT_PASSWORD: "${IMS_DB_ROOT_PASSWORD:-ims-root}" | ||
volumes: | ||
- ./.docker/mysql/data/:/var/lib/mysql | ||
healthcheck: | ||
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"] | ||
interval: 10s | ||
timeout: 5s | ||
retries: 5 | ||
|
||
networks: | ||
default: | ||
name: "${DOCKER_RANGERS_NETWORK:-rangers}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What reads these
*.env
files?docker-compose
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, docker-compose reads them in and uses them to populate vars in the file, some of which are passed through to the services.