Skip to content
This repository has been archived by the owner on May 29, 2020. It is now read-only.

Commit

Permalink
Merge pull request #1 from paritytrading/features/fix
Browse files Browse the repository at this point in the history
Add 'parity-fix' module
  • Loading branch information
jvirtanen authored Nov 2, 2016
2 parents 450b5db + 74b097e commit f8b5e71
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ This repository consists of the following modules:
- [**Parity Trading System**](parity-system) defines a Docker image for the
matching engine

- [**Parity FIX Gateway**](parity-fix) defines a Docker image for the
Financial Information Exchange (FIX) gateway


Links
-----
Expand Down
13 changes: 13 additions & 0 deletions parity-fix/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM openjdk:8-jre-alpine

ENV PARITY_VERSION "0.5.0"

ADD https://repo1.maven.org/maven2/com/paritytrading/parity/parity-fix/$PARITY_VERSION/parity-fix-$PARITY_VERSION.jar /opt/parity/parity-fix.jar

RUN chmod 644 /opt/parity/parity-fix.jar

COPY docker-entrypoint.sh /

EXPOSE 4010

ENTRYPOINT [ "/docker-entrypoint.sh" ]
26 changes: 26 additions & 0 deletions parity-fix/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Parity FIX Gateway
==================

This directory defines a Docker image for the Financial Information Exchange
(FIX) gateway.


Configuration
-------------

The Docker container is configured using environment variables.

The following environment variables are optional:

- `PARITY_FIX_ORDER_ENTRY_ADDRESS`: The IP address of the matching engine.

- `PARITY_FIX_ORDER_ENTRY_PORT`: The TCP port for order entry at the matching
engine.


Build
-----

Build the Docker image:

docker build --tag parity-fix .
18 changes: 18 additions & 0 deletions parity-fix/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh

set -e

cat > /opt/parity/parity-fix.conf <<-EOF
fix {
address = 0.0.0.0
port = 4010
sender-comp-id = parity
}
order-entry {
address = ${PARITY_FIX_ORDER_ENTRY_ADDRESS:-"parity-system"}
port = ${PARITY_FIX_ORDER_ENTRY_PORT:-"4000"}
}
EOF

exec /usr/bin/java -jar /opt/parity/parity-fix.jar /opt/parity/parity-fix.conf

0 comments on commit f8b5e71

Please sign in to comment.