Skip to content

Commit 3dff80a

Browse files
committed
reduce image size
1 parent 6699ed4 commit 3dff80a

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

Dockerfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
FROM golang
1+
FROM golang as builder
22
WORKDIR /app
33
COPY . .
44
WORKDIR /app/client
5-
RUN go build -o app .
5+
RUN export CGO_ENABLED=0 && go build -o app .
66
WORKDIR /app/server
7-
RUN go build -o app .
7+
RUN export CGO_ENABLED=0 && go build -o app .
88
WORKDIR /app
99
RUN chmod +x start.sh
10+
11+
FROM alpine
12+
COPY --from=builder /app /app
1013
EXPOSE 80 1180
1114
CMD ["/app/start.sh"]

start.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/bin/sh
22
if [ -z $ws ]; then
33
echo "Starting server"
44
/app/server/app

0 commit comments

Comments
 (0)