-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
98a1e36
commit 7ea8d71
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Start from base image 1.15.16 | ||
FROM golang:1.15.6 | ||
|
||
# Configure the repo url so it can configure the work directory | ||
ENV REPO_URL=/Users/jamestang/Desktop/Project/bookstore-items-api | ||
|
||
# ENV GOPATH=/Users/jamestang/go | ||
|
||
ENV APP_PATH=${REPO_URL} | ||
|
||
# Cpoy the entire source code from the current directory to $WORKPATH | ||
ENV WORKPATH=${APP_PATH}/src | ||
COPY src $WORKPATH | ||
WORKDIR ${WORKPATH} | ||
|
||
RUN go build -o items-api . | ||
|
||
# Expose port 8090 to the world: | ||
EXPOSE 8090 | ||
|
||
CMD ["./items-api"] | ||
|
||
|
||
# Step | ||
# docker build -t main . | ||
# docker build -t items-api . | ||
# docker run -p 8090:8090 -p 9200:9200 items-api:latest or docker run -p 8090:8090 items-api:latest |