-
Notifications
You must be signed in to change notification settings - Fork 8
/
Dockerfile-admin-web
41 lines (28 loc) · 1.24 KB
/
Dockerfile-admin-web
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
## This is a Dockerfile for cb-network admin-web
##############################################################
## Stage 1 - Go Build
##############################################################
FROM golang:1.19 AS builder
ENV GO111MODULE=on
COPY . /cb-larva
WORKDIR /cb-larva/poc-cb-net/cmd/admin-web/
# Build the admin-web
# Note - Using cgo write normal Go code that imports a pseudo-package "C". I may not need on cross-compiling.
# Note - You can find possible platforms by 'go tool dist list' for GOOS and GOARCH
# Note - Using the -ldflags parameter can help set variable values at compile time.
# Note - Using the -s and -w linker flags can strip the debugging information.
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -ldflags '-s -w' -o admin-web
#############################################################
## Stage 2 - Application Setup
##############################################################
FROM alpine:latest
WORKDIR /app
RUN mkdir -p config
RUN mkdir -p web
# Copy the execution file
COPY --from=builder /cb-larva/poc-cb-net/cmd/admin-web/admin-web .
# Copy the web files of the admin-web
COPY --from=builder /cb-larva/poc-cb-net/web/ ./web/
# Ports for the cb-network admin-web
EXPOSE 8054
ENTRYPOINT ["./admin-web"]