generated from codewithkyle/spa-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.http
More file actions
33 lines (22 loc) · 807 Bytes
/
Dockerfile.http
File metadata and controls
33 lines (22 loc) · 807 Bytes
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
# Step 1: Use an official Go image to build the Go application
FROM golang:1.22-alpine AS builder
# Step 2: Set the working directory inside the container
WORKDIR /app
# Step 3: Copy the Go modules and dependencies
COPY ./server/. ./
# Step 4: Download necessary Go dependencies
RUN go mod download
# Step 6: Build the Go application
RUN go build -ldflags="-s -w" -o tabletopper .
# Step 7: Create a small image to run the application
FROM alpine:latest
# Step 8: Set the working directory in the final image
WORKDIR /root/
# Step 9: Copy the Go binary from the builder stage
COPY --from=builder /app/tabletopper .
COPY ./server/views ./views
COPY ./client/public ./public
# Step 10: Expose the port that the app will run on
EXPOSE 3000
# Step 11: Command to run the Go app
CMD ["./tabletopper"]