Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
FROM openjdk:8u121-jdk-alpine
RUN apk update && apk add curl bash
ADD https://private/url/for/datomic-pro.zip /datomic-pro.zip
RUN mkdir /datomic && unzip /datomic-pro.zip -d /datomic
ADD go.sh /go.sh
RUN chmod 755 /go.sh
EXPOSE 4334
CMD /go.sh
#!/bin/sh -xe
cd /datomic/datomic-*
cat <<EOF > aws.properties
host=`curl -q http://169.254.169.254/latest/meta-data/local-ipv4`
aws-cloudwatch-region=${REGION}
aws-dynamodb-region=${REGION}
aws-transactor-role=${TRANSACTOR_ROLE}
aws-peer-role=${PEER_ROLE}
protocol=${PROTOCOL}
memory-index-max=${MEMORY_INDEX_MAX}
heartbeat-interval-msec=${HEARTBEAT_INTERVAL_MSEC}
port=4334
memory-index-threshold=${MEMORY_INDEX_THRESHOLD}
aws-cloudwatch-dimension-value=${CLOUDWATCH_DIMENSION}
object-cache-max=${OBJECT_CACHE_MAX}
license-key=${LICENSE_KEY}
aws-dynamodb-table=${DDB_TABLE}
EOF
bin/transactor -Xms${XMX} -Xmx${XMX} aws.properties
{
"taskDefinition": {
"status": "ACTIVE",
"networkMode": "host",
"family": "YOUR_FAMILY",
"placementConstraints": [],
"requiresAttributes": [
{
"name": "com.amazonaws.ecs.capability.docker-remote-api.1.17"
},
{
"name": "com.amazonaws.ecs.capability.docker-remote-api.1.18"
},
{
"name": "com.amazonaws.ecs.capability.ecr-auth"
}
],
"compatibilities": [
"EC2"
],
"volumes": [],
"requiresCompatibilities": [],
"taskDefinitionArn": "ARN_IN_YOUR_ACCOUNT",
"containerDefinitions": [
{
"dnsSearchDomains": [],
"environment": [
{
"name": "LICENSE_KEY",
"value": "YOUR_LICENSE_KEY_HERE"
},
{
"name": "DDB_TABLE",
"value": "YOUR_DDB_TABLE_HERE"
},
{
"name": "XMX",
"value": "2816M"
},
{
"name": "MEMORY_INDEX_MAX",
"value": "350m"
},
{
"name": "PEER_ROLE",
"value": "YOUR_PEER_ROLE"
},
{
"name": "TRANSACTOR_ROLE",
"value": "YOUR_TRANSACTOR_ROLE"
},
{
"name": "PROTOCOL",
"value": "ddb"
},
{
"name": "MEMORY_INDEX_THRESHOLD",
"value": "32m"
},
{
"name": "HEARTBEAT_INTERVAL_MSEC",
"value": "15000"
},
{
"name": "CLOUDWATCH_DIMENSION",
"value": "transactor-prod"
},
{
"name": "OBJECT_CACHE_MAX",
"value": "700m"
},
{
"name": "REGION",
"value": "us-west-2"
}
],
"name": "datomic-transactor",
"links": [],
"mountPoints": [],
"image": "YOUR_IMAGE_TAG",
"dockerLabels": {},
"essential": true,
"portMappings": [],
"dnsServers": [],
"dockerSecurityOptions": [],
"entryPoint": [],
"ulimits": [],
"memory": 3954,
"command": [],
"extraHosts": [],
"cpu": 0,
"volumesFrom": []
}
],
"revision": 1
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment