Skip to content

Commit 0ecfd81

Browse files
committedAug 3, 2023
feat: smaller docker images using alpine, published to github container registry
1 parent 0470843 commit 0ecfd81

File tree

8 files changed

+43
-17
lines changed

8 files changed

+43
-17
lines changed
 

‎.dockerignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.yarn/cache
2+
.yarn/install-state.gz
3+
4+
contracts/.env
5+
contracts/test
6+
contracts/lib
7+
contracts/cache
8+
contracts/cache_hardhat
9+
contracts/config
10+
contracts/tenderly.yaml
11+
12+
*/.DS_Store
13+
*/*.log

‎contracts/.dockerignore

Lines changed: 0 additions & 9 deletions
This file was deleted.

‎services/bots/.env.testnet.example

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Bot account
2+
PRIVATE_KEY=0x000000.....00000
3+
4+
# Bot subgraph
5+
SUBGRAPH_URL=https://api.thegraph.com/subgraphs/name/alcercu/kleroscoretest
6+
7+
# Logging
8+
LOG_LEVEL=debug
9+
LOGTAIL_TOKEN=<optional token>
10+
11+
# Heartbeat
12+
HEARTBEAT_URL_KEEPER_BOT=<optional url>

‎services/bots/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.env.testnet
2+
.env.mainnet

‎services/bots/Dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM --platform=arm64 node:16-bookworm
1+
FROM node:16-alpine
22

33
WORKDIR /usr/src/app
44

@@ -22,3 +22,8 @@ RUN yarn set version 3.3.1 && \
2222
USER node
2323
WORKDIR /usr/src/app/contracts
2424
ENTRYPOINT [ "yarn" ]
25+
26+
LABEL org.opencontainers.image.source=https://github.com/kleros/kleros-v2
27+
LABEL org.opencontainers.image.title="Kleros v2 Bots"
28+
LABEL org.opencontainers.image.description="Bots for the Kleros v2 arbitration protocol."
29+
LABEL org.opencontainers.image.licenses=MIT

‎services/bots/common.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,8 @@ services:
44
build:
55
context: ../../
66
dockerfile: ./services/bots/Dockerfile
7-
image: kleros-v2-bots
7+
tags:
8+
- kleros-v2-bots
9+
image: ghcr.io/kleros/kleros-v2-bots
10+
pull_policy: missing
811
command: --help

‎services/bots/docker-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ services:
77
# command: bot:keeper --network arbitrumGoerli
88
entrypoint:
99
[
10-
"/bin/bash",
10+
"/bin/sh",
1111
"-c",
1212
"pm2-runtime ecosystem.config.js --only keeper-bot-testnet --no-auto-exit"
1313
]
1414
# entrypoint:
1515
# [
16-
# "/bin/bash",
16+
# "/bin/sh",
1717
# "-c",
1818
# "pm2-runtime ecosystem.config.js --only foo --no-auto-exit"
1919
# ]
@@ -30,7 +30,7 @@ services:
3030
# command: bot:relayer-from-chiado --network arbitrumGoerli
3131
entrypoint:
3232
[
33-
"/bin/bash",
33+
"/bin/sh",
3434
"-c",
3535
"pm2-runtime ecosystem.config.js --only relayer-bot-from-chiado-testnet --no-auto-exit"
3636
]

‎services/bots/ecosystem.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@ module.exports = {
22
apps: [
33
{
44
name: "foo",
5-
interpreter: "bash",
5+
interpreter: "sh",
66
script: "yarn",
77
args: "foo",
88
restart_delay: 3000,
99
autorestart: true,
1010
},
1111
{
1212
name: "keeper-bot-testnet",
13-
interpreter: "bash",
13+
interpreter: "sh",
1414
script: "yarn",
1515
args: "bot:keeper --network arbitrumGoerli",
1616
restart_delay: 600000,
1717
autorestart: true,
1818
},
1919
{
2020
name: "relayer-bot-from-chiado-testnet",
21-
interpreter: "bash",
21+
interpreter: "sh",
2222
script: "yarn",
2323
args: "bot:relayer-from-chiado --network arbitrumGoerli",
2424
restart_delay: 2000,

0 commit comments

Comments
 (0)
Please sign in to comment.