saniales / golang-crypto-trading-bot

A golang implementation of a console-based trading bot for cryptocurrency exchanges
GNU General Public License v3.0
1.08k stars 243 forks source link

How to integrate with Docker (Dockerize) ? #121

Closed kozld closed 10 months ago

kozld commented 2 years ago

I think that it can maybe helpfully. What do you think?

saniales commented 2 years ago

Hello and thanks for asking

Are you thinking of a particular entry point integration or something generic would suit?

saniales commented 1 year ago

I thought about a generic Dockerized implementation

FROM go:latest as builder
ADD .
RUN go build -o /tmp/golang-crypto-trading-bot 

FROM scratch

ADD config.yaml ./config.yaml
COPY --from=builder /tmp/golang-crypto-trading-bot ./golang-crypto-trading-bot 

CMD ["golang-crypto-trading-bot"]

that should do it (I did not test it) @kozld

saniales commented 10 months ago

After careful thinking about this, the manual Dockerfile is a better solution for anyone implementing any bot based on this framework, ergo I would keep any Docker version out of this repo.

If anybody needs to dockerize a project, can use the Dockerfile I provided in the other comment.