-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (28 loc) · 1.16 KB
/
Dockerfile
File metadata and controls
36 lines (28 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# syntax=docker/dockerfile:1
# Builder from adrianceding/binance-proxy
FROM golang AS builder
WORKDIR /src/app
RUN git clone --depth 1 --branch $(curl --silent "https://api.github.com/repos/adrianceding/binance-proxy/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') https://github.com/adrianceding/binance-proxy.git && cd binance-proxy/src/binance-proxy && CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o /src/app/dist/binance-proxy .
# Container from builder
FROM debian:stable-slim
LABEL maintainer="Kawin Viriyaprasopsook <kawin.vir@zercle.tech>"
ARG timezone=Asia/Bangkok
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
ENV TZ $timezone
# Update OS
RUN apt update && apt -y full-upgrade \
&& apt -y install locales tzdata net-tools bash-completion ca-certificates
# Change locale
RUN echo $timezone > /etc/timezone \
&& cp /usr/share/zoneinfo/$timezone /etc/localtime
# Create app dir
RUN mkdir -p /app
WORKDIR /app
COPY --from=builder /src/app/dist/binance-proxy /app/
RUN chmod +x /app/binance-proxy && ln -sf /app/binance-proxy /usr/local/bin/binance-proxy
EXPOSE 8090 8091
# startup script
ENTRYPOINT ["binance-proxy"]
# fallback
CMD ["binance-proxy"]