-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
39 lines (27 loc) · 995 Bytes
/
Dockerfile
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
37
38
39
FROM golang:1.19-alpine as build
# Set up apk dependencies
ENV PACKAGES make git libc-dev bash gcc linux-headers eudev-dev curl ca-certificates
# Set working directory for the build
WORKDIR /opt/app
# Add source files
COPY . .
# Install minimum necessary dependencies, remove packages
RUN apk add --no-cache $PACKAGES && \
make build
FROM alpine:3.17
WORKDIR /opt/app
RUN mkdir /opt/app/config
COPY config/config.json /opt/app/config/config.json
COPY --from=build /opt/app/build/relayer /opt/app/relayer
ENV RELAYER_HOME /opt/app
ENV AFC_NETWORK 1
ENV CONFIG_FILE_PATH $RELAYER_HOME/config/config.json
ENV CONFIG_TYPE "local"
# You need to specify aws s3 config if you want to load config from s3
ENV AWS_REGION ""
ENV AWS_SECRET_KEY ""
# Run as non-root user for security
USER 1000
VOLUME [ $RELAYER_HOME ]
# Run the app
CMD ./relayer --afc-network $AFC_NETWORK --config-type $CONFIG_TYPE --config-path $CONFIG_FILE_PATH --aws-region $AWS_REGION --aws-secret-key $AWS_SECRET_KEY