23 lines
790 B
Docker
23 lines
790 B
Docker
ARG GOLANG_TAG=193044292705.dkr.ecr.ap-south-1.amazonaws.com/common/golang:1.22.4
|
|
|
|
# To run locally, use
|
|
#ARG GOLANG_TAG=registry.cmd.navi-tech.in/common/golang:1.19
|
|
|
|
FROM ${GOLANG_TAG} as builder
|
|
RUN mkdir -p /build
|
|
WORKDIR /build
|
|
COPY . /build
|
|
RUN /bin/bash -c "make build-migrations"
|
|
RUN /bin/bash -c "make build-cybertron"
|
|
|
|
FROM ${GOLANG_TAG}
|
|
RUN mkdir -p /usr/local
|
|
WORKDIR /usr/local
|
|
COPY --from=0 /build/out/cybertron /usr/local/
|
|
COPY --from=0 /build/out/migrations /usr/local/migrations
|
|
COPY --from=0 /build/db/migrations/*.sql /usr/local/db/migrations/
|
|
COPY --from=0 /build/configs/application.yml /usr/local/configs/
|
|
RUN adduser --system --uid 4000 --disabled-password api-user && chown -R 4000:4000 /usr/local && chmod -R g+w /usr/local/
|
|
USER 4000
|
|
CMD /bin/bash -c "./cybertron"
|