27 lines
1.1 KiB
Docker
27 lines
1.1 KiB
Docker
ARG GOLANG_TAG=193044292705.dkr.ecr.ap-south-1.amazonaws.com/common/golang:1.23.8
|
|
|
|
# To run locally, use
|
|
#ARG GOLANG_TAG=registry.cmd.navi-tech.in/common/golang:1.22.12
|
|
|
|
FROM ${GOLANG_TAG} as builder
|
|
RUN mkdir -p /build/ferret
|
|
RUN mkdir -p /root/.ssh && echo "Host *\n StrictHostKeyChecking no" > ~/.ssh/config && chmod 0400 /root/.ssh
|
|
ARG SSH_KEY
|
|
RUN echo "${SSH_KEY}" > /root/.ssh/id_rsa \
|
|
&& chmod 0600 /root/.ssh/id_rsa \
|
|
&& git config --global url."git@github.com:".insteadOf "https://github.com/" \
|
|
&& go env -w GOPRIVATE='github.com/navi-*'
|
|
WORKDIR /build/ferret/
|
|
COPY . /build/ferret/
|
|
RUN /bin/bash -c "make build-ferret"
|
|
|
|
FROM ${GOLANG_TAG}
|
|
RUN mkdir -p /usr/local
|
|
WORKDIR /usr/local
|
|
COPY --from=0 /build/ferret/alfred-ferret /usr/local/
|
|
COPY --from=0 /build/ferret/config/application-ferret.properties /usr/local/config/
|
|
COPY --from=0 /build/ferret/config/elasticapm-ferret.properties /usr/local/config/
|
|
RUN adduser --system --uid 4000 --disabled-password app-user && chown -R 4000:4000 /usr/local && chmod -R g+w /usr/local/
|
|
USER 4000
|
|
CMD /bin/bash -c "./alfred-ferret"
|