jesonouyang commited on
Commit
04dd942
·
1 Parent(s): 21e96c0

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +23 -10
Dockerfile CHANGED
@@ -1,25 +1,38 @@
1
- FROM golang:1.18-alpine
 
2
 
3
- # Install Node.js, Git, curl, and sudo
4
- RUN apk add --no-cache nodejs npm git curl sudo
5
 
6
- # Clone user-manager code
7
- RUN git clone https://github.com/1005281342/user-manager.git
 
 
 
 
8
 
9
- ENV BINDIR=/bin
 
 
 
 
 
10
 
11
  # Install Bud
12
- RUN curl -sf https://raw.githubusercontent.com/livebud/bud/main/install.sh | sh
 
 
 
 
 
13
 
14
- RUN ls -la /bin
15
- RUN chmod +x /bin/bud
16
 
17
  # Install dependencies and build the application
18
  WORKDIR user-manager
19
  RUN npm install
20
 
21
  # Build the application
22
- RUN /bin/bud build
23
 
24
  # Start the service
25
  CMD ["./bud/app"]
 
1
+ ARG NODE_VERSION=16.15.1
2
+ FROM node:${NODE_VERSION}-slim
3
 
4
+ ARG GO_VERSION=1.18.3
5
+ ARG BUD_VERSION=main
6
 
7
+ RUN node -v
8
+
9
+ # Install basic dependencies
10
+ RUN apt-get -qq update \
11
+ && apt-get -qq -y install curl git make gcc g++ \
12
+ && rm -rf /var/lib/apt/lists/*
13
 
14
+ # Install Go
15
+ RUN curl -L --output - https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz | tar -xz -C /usr/local --strip-components 1
16
+ RUN go version
17
+ ENV PATH "/root/go/bin:${PATH}"
18
+
19
+ RUN git clone https://github.com/1005281342/user-manager.git
20
 
21
  # Install Bud
22
+ RUN git clone https://github.com/livebud/bud /bud
23
+ WORKDIR /bud
24
+ RUN git checkout $BUD_VERSION
25
+ RUN make install
26
+ RUN go install .
27
+ RUN bud version
28
 
 
 
29
 
30
  # Install dependencies and build the application
31
  WORKDIR user-manager
32
  RUN npm install
33
 
34
  # Build the application
35
+ RUN bud build
36
 
37
  # Start the service
38
  CMD ["./bud/app"]