diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..228a7c5 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM golang:1.23-alpine AS builder +WORKDIR /app +COPY . . +#RUN echo "export GOPROXY=https://goproxy.io/" >> ~/.bashrc + +RUN export GOPROXY=https://goproxy.io/ && go mod tidy +RUN go build -o test ./worker/service/main.go + +FROM alpine +WORKDIR /app +ENV REDIS_HOST="172.17.0.1:6379" SERVER_PORT="6600" +#ENV SERVER_PORT="6600" +COPY --from=builder /app/test /usr/bin/worker +EXPOSE $SERVER_PORT +#ENTRYPOINT ["worker"] +CMD ["sh","-c","worker --port :$SERVER_PORT --redis $REDIS_HOST"] +#CMD worker --port :$SERVER_PORT --redis $REDIS_HOST