33 lines
693 B
Docker
33 lines
693 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
|
|
|
|
WORKDIR /app
|
|
|
|
RUN apt update &&\
|
|
apt install bash curl wget -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" ]
|