-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
44 lines (30 loc) · 1.05 KB
/
Copy pathDockerfile
File metadata and controls
44 lines (30 loc) · 1.05 KB
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
# Use the official Golang image to create a build artifact.
FROM golang:1.18 as builder
WORKDIR /app
# Copy the Go Modules manifests
COPY signalling/go.mod signalling/go.sum ./
# Download the dependencies
RUN go mod download
# Copy the source code from the signalling directory
COPY signalling/ .
# Build the application
RUN CGO_ENABLED=0 GOOS=linux go build -o main ./cmd/signalling
# Use Nginx image
FROM nginx:alpine
# Remove the default Nginx configuration file
RUN rm /etc/nginx/conf.d/default.conf
# Copy a new configuration file from your project
COPY nginx.conf /etc/nginx/conf.d/nginx.conf.template
RUN apk --no-cache add ca-certificates
WORKDIR /root/
# Copy the pre-built binary file from the previous stage
COPY --from=builder /app/main /usr/local/bin/main
# Copy the start.sh script
COPY signalling/start.sh .
# Ensure start.sh is executable
RUN chmod +x start.sh
# Expose the port the app runs on
EXPOSE 80 443 18937
# Use the start script as the entry point
# cat the generated start.sh script to see the contents
CMD ["/bin/sh", "./start.sh"]