-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #187 from zond/johnpooch/add-docker
Add Dockerfile and update README
- Loading branch information
Showing
2 changed files
with
53 additions
and
8 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,38 @@ | ||
# Start with a base image containing golang runtime | ||
FROM golang:1.20 | ||
|
||
# Downloading gcloud package | ||
RUN curl https://dl.google.com/dl/cloudsdk/release/google-cloud-sdk.tar.gz > /tmp/google-cloud-sdk.tar.gz | ||
|
||
# Installing the package | ||
RUN mkdir -p /usr/local/gcloud \ | ||
&& tar -C /usr/local/gcloud -xvf /tmp/google-cloud-sdk.tar.gz \ | ||
&& /usr/local/gcloud/google-cloud-sdk/install.sh | ||
|
||
# Install the gcloud component that includes the App Engine extension for Go. | ||
RUN /usr/local/gcloud/google-cloud-sdk/bin/gcloud components install app-engine-go | ||
|
||
# Add the gcloud command-line tool to your path. | ||
ENV PATH $PATH:/usr/local/gcloud/google-cloud-sdk/bin | ||
|
||
# # Run dev_appserver.py . from inside the repo | ||
# RUN dev_appserver.py . | ||
|
||
# Set the working directory in the container | ||
WORKDIR /go/src/app | ||
|
||
# Copy the current directory contents into the container at /go/src/app | ||
COPY . . | ||
|
||
# Remove Dockerfile to prevent issue with App Engine | ||
RUN rm Dockerfile | ||
|
||
# Expose port 8080 to the outside world | ||
EXPOSE 8080 | ||
|
||
# Expose port 8000 to the outside world | ||
EXPOSE 8000 | ||
|
||
# Start the process | ||
CMD ["python3", "../../../usr/local/gcloud/google-cloud-sdk/bin/dev_appserver.py", "--host=0.0.0.0", "--admin_host=0.0.0.0", "."] | ||
|
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