Mercurial > famtree
annotate backend/dockerfile @ 0:a17a4894f4bd draft default tip
Initial commit converting git to mercurial
author | Alfred Burgess <aburgess@ucc.asn.au> |
---|---|
date | Sun, 14 Apr 2024 19:35:23 +0800 |
parents | |
children |
rev | line source |
---|---|
0
a17a4894f4bd
Initial commit converting git to mercurial
Alfred Burgess <aburgess@ucc.asn.au>
parents:
diff
changeset
|
1 # Use an official Go runtime as a parent image |
a17a4894f4bd
Initial commit converting git to mercurial
Alfred Burgess <aburgess@ucc.asn.au>
parents:
diff
changeset
|
2 FROM golang:latest |
a17a4894f4bd
Initial commit converting git to mercurial
Alfred Burgess <aburgess@ucc.asn.au>
parents:
diff
changeset
|
3 |
a17a4894f4bd
Initial commit converting git to mercurial
Alfred Burgess <aburgess@ucc.asn.au>
parents:
diff
changeset
|
4 # Set the working directory inside the container |
a17a4894f4bd
Initial commit converting git to mercurial
Alfred Burgess <aburgess@ucc.asn.au>
parents:
diff
changeset
|
5 WORKDIR /app |
a17a4894f4bd
Initial commit converting git to mercurial
Alfred Burgess <aburgess@ucc.asn.au>
parents:
diff
changeset
|
6 |
a17a4894f4bd
Initial commit converting git to mercurial
Alfred Burgess <aburgess@ucc.asn.au>
parents:
diff
changeset
|
7 # Copy the local package files to the container's workspace |
a17a4894f4bd
Initial commit converting git to mercurial
Alfred Burgess <aburgess@ucc.asn.au>
parents:
diff
changeset
|
8 COPY . . |
a17a4894f4bd
Initial commit converting git to mercurial
Alfred Burgess <aburgess@ucc.asn.au>
parents:
diff
changeset
|
9 |
a17a4894f4bd
Initial commit converting git to mercurial
Alfred Burgess <aburgess@ucc.asn.au>
parents:
diff
changeset
|
10 # Build the Go application |
a17a4894f4bd
Initial commit converting git to mercurial
Alfred Burgess <aburgess@ucc.asn.au>
parents:
diff
changeset
|
11 RUN go build main.go |
a17a4894f4bd
Initial commit converting git to mercurial
Alfred Burgess <aburgess@ucc.asn.au>
parents:
diff
changeset
|
12 |
a17a4894f4bd
Initial commit converting git to mercurial
Alfred Burgess <aburgess@ucc.asn.au>
parents:
diff
changeset
|
13 # Build |
a17a4894f4bd
Initial commit converting git to mercurial
Alfred Burgess <aburgess@ucc.asn.au>
parents:
diff
changeset
|
14 #RUN CGO_ENABLED=0 GOOS=linux go build -o /webapp |
a17a4894f4bd
Initial commit converting git to mercurial
Alfred Burgess <aburgess@ucc.asn.au>
parents:
diff
changeset
|
15 |
a17a4894f4bd
Initial commit converting git to mercurial
Alfred Burgess <aburgess@ucc.asn.au>
parents:
diff
changeset
|
16 # Expose port 8080 to the outside world |
a17a4894f4bd
Initial commit converting git to mercurial
Alfred Burgess <aburgess@ucc.asn.au>
parents:
diff
changeset
|
17 EXPOSE 8080 |
a17a4894f4bd
Initial commit converting git to mercurial
Alfred Burgess <aburgess@ucc.asn.au>
parents:
diff
changeset
|
18 |
a17a4894f4bd
Initial commit converting git to mercurial
Alfred Burgess <aburgess@ucc.asn.au>
parents:
diff
changeset
|
19 # Command to run the executable |
a17a4894f4bd
Initial commit converting git to mercurial
Alfred Burgess <aburgess@ucc.asn.au>
parents:
diff
changeset
|
20 CMD ["./main"] |