trepa/Dockerfile
2025-02-20 12:09:38 +00:00

33 lines
698 B
Docker

FROM golang:1.24 AS build
WORKDIR /app
COPY cmd/ cmd/
COPY internal/ internal/
COPY go.mod .
COPY go.sum .
COPY scripts/ scripts/
RUN chmod +x scripts/build.sh && \
./scripts/build.sh
FROM debian:bookworm-slim AS runner
WORKDIR /app
RUN apt update &&\
apt install bash curl -y &&\
wget https://github.com/golang-migrate/migrate/releases/download/v4.18.2/migrate.linux-amd64.deb &&\
dpkg -i migrate.linux-amd64.deb &&\
rm migrate.linux-amd64.deb &&\
apt install cron -y
COPY --from=build /app/dist/ dist/
COPY migrations/ migrations/
COPY scripts/startup.sh scripts/
RUN chmod +x scripts/startup.sh
RUN chmod +x -R dist/
CMD [ "/bin/bash", "scripts/startup.sh" ]