-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
63 lines (54 loc) · 1.7 KB
/
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
FROM golang:1.15 as build
WORKDIR /project
COPY go.mod .
RUN go mod download
COPY . /project
RUN make build
FROM golang:1.15 as api-server-build
WORKDIR /project
COPY go.mod .
RUN go mod download
COPY . /project
RUN make build api_server
FROM golang:1.15 as session-service-build
WORKDIR /project
COPY go.mod .
RUN go mod download
COPY . /project
RUN make build session_service
FROM golang:1.15 as cart-service-build
WORKDIR /project
COPY go.mod .
RUN go mod download
COPY . /project
RUN make build cart_service
FROM golang:1.15 as auth-service-build
WORKDIR /project
COPY go.mod .
RUN go mod download
COPY . /project
RUN make build auth_service
FROM ubuntu:latest as api-server
RUN apt update && apt install ca-certificates -y && rm -rf /var/cache/apt/*
COPY --from=api-server-build /project/bin/api_server /
CMD ["./api_server"]
FROM ubuntu:latest as session-service
RUN apt update && apt install ca-certificates -y && rm -rf /var/cache/apt/*
COPY --from=session-service-build /project/bin/session_service /
CMD ["./session_service"]
FROM ubuntu:latest as cart-service
RUN apt update && apt install ca-certificates -y && rm -rf /var/cache/apt/*
COPY --from=cart-service-build /project/bin/cart_service /
CMD ["./cart_service"]
FROM ubuntu:latest as auth-service
RUN apt update && apt install ca-certificates -y && rm -rf /var/cache/apt/*
COPY --from=auth-service-build /project/bin/auth_service /
CMD ["./auth_service"]
FROM postgres:13 as api-db
RUN apt update && \
apt install myspell-ru -y
WORKDIR /usr/share/postgresql/13/tsearch_data
ENV DICT=/usr/share/hunspell/ru_RU
ENV POSTGRES_HOST_AUTH_METHOD=trust
RUN iconv -f koi8-r -t utf-8 -o russian.affix $DICT.aff && \
iconv -f koi8-r -t utf-8 -o russian.dict $DICT.dic