forked from amacneil/dbmate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
38 lines (34 loc) · 881 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# development image
FROM golang:1.21.6 as dev
WORKDIR /src
ENV PATH="/src/typescript/node_modules/.bin:${PATH}"
RUN git config --global --add safe.directory /src
# install development tools
RUN apt-get update \
&& apt-get install -qq --no-install-recommends \
curl \
file \
mariadb-client \
postgresql-client \
sqlite3 \
nodejs \
npm \
&& rm -rf /var/lib/apt/lists/*
# golangci-lint
RUN curl -fsSL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh \
| sh -s -- -b /usr/local/bin v1.55.2
# download modules
COPY go.* /src/
RUN go mod download
COPY . /src/
RUN make build
# release stage
FROM alpine:3.19.0 as release
RUN apk add --no-cache \
mariadb-client \
mariadb-connector-c \
postgresql-client \
sqlite \
tzdata
COPY --from=dev /src/dist/dbmate /usr/local/bin/dbmate
ENTRYPOINT ["/usr/local/bin/dbmate"]