Move migrate tool to container

This commit is contained in:
komissarovyv committed 2024-11-20 14:31:52 +03:00
1 parent 93f2a5ed50
commit 83355f8bbc
5 files changed
+12 -17

No files matched your search

+7 -1
View File
@@ -1,4 +1,4 @@
FROM golang:1.23-alpine3.20 as builder
FROM golang:1.23-alpine as builder
WORKDIR /build
ARG version
ENV version_env=$version
@@ -7,6 +7,8 @@ ENV app_name_env=$app_name
COPY . .
RUN apk update && apk upgrade && apk add --no-cache gcc musl-dev
RUN go build -ldflags="-X 'main.version=$version_env'" -o /main .
WORKDIR cmd/migrate
RUN CGO_ENABLED=1 go build -o /migrate .
FROM alpine:3.20
@@ -14,6 +16,10 @@ RUN apk add --no-cache tzdata
RUN cp /usr/share/zoneinfo/Europe/Moscow /etc/localtime
RUN echo "Europe/Moscow" > /etc/timezone
COPY --from=builder migrate /migrate/migrate
COPY cmd/migrate/config.yml /migrate/config.yml
RUN chmod 666 /migrate/config.yml
ARG UID=10001
RUN adduser \
--disabled-password \