Skip to content

Commit

Permalink
Update the dockerfile and format main.go
Browse files Browse the repository at this point in the history
  • Loading branch information
pottava committed Jan 30, 2017
1 parent b09dc18 commit 0c4cd39
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
4 changes: 1 addition & 3 deletions dev/docker-compose-gox.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# export BUILD_VERSION=v0.1.0
# export BUILD_DATE=2016-02-15T12:00:00+0900
# docker-compose -f dev/docker-compose-gox.yml run --rm build
# BUILD_VERSION=v0.1.0 BUILD_DATE=`date +%FT%T%z` docker-compose -f development/docker-compose-gox.yml run --rm build

build:
image: pottava/gox:go1.8
Expand Down
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,4 @@ services:
- SSL_CERT_PATH
- SSL_KEY_PATH
- ACCESS_LOG=true
- GO15VENDOREXPERIMENT=1
container_name: app
8 changes: 4 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,10 @@ func awss3(w http.ResponseWriter, r *http.Request) {
}

func s3get(backet, key string) (*s3.GetObjectOutput, error) {
sess, err := session.NewSession(&aws.Config{Region: aws.String(c.awsRegion)})
if err != nil {
log.Printf("[service] unable to create aws session: %s", err)
}
sess, err := session.NewSession(&aws.Config{Region: aws.String(c.awsRegion)})
if err != nil {
log.Printf("[service] unable to create aws session: %s", err)
}
req := &s3.GetObjectInput{
Bucket: aws.String(backet),
Key: aws.String(key),
Expand Down
4 changes: 2 additions & 2 deletions prod/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ RUN apk --no-cache add --virtual build-dependencies bash gcc musl-dev openssl go

# Compile s3-proxy
&& go get -u github.com/pottava/aws-s3-proxy \
&& mv /go/bin/aws-s3-proxy /aws-s3-proxy \
&& mv /go/bin/aws-s3-proxy /usr/bin \

# Clean up
&& apk del --purge build-dependencies \
&& rm -rf /usr/local/go /usr/lib/go /go /golang.tar.gz /*.patch

EXPOSE 80

CMD ["/aws-s3-proxy"]
CMD ["aws-s3-proxy"]

0 comments on commit 0c4cd39

Please sign in to comment.