Skip to content

Commit b809e52

Browse files
committedAug 12, 2018
Fix Dockerfile
1 parent 3d23adf commit b809e52

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed
 

‎Dockerfile

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.9-alpine
1+
FROM golang:1.9-alpine AS builder
22

33
# Install curl, git
44
RUN apk add --no-cache curl, git
@@ -32,15 +32,15 @@ RUN sh build/fetch_plugins.sh
3232

3333
# Setup configuration file
3434
RUN cp config/config.example.yml config/config.yml \
35-
&& sed -i 's!postgres\b!$DB_DIALECT!g' config/config.yml \
36-
&& sed -i 's!postgresql://user:password@host/dbname?sslmode=disable!$DB_CONNECTION_STRING!g' config/config.yml \
37-
&& sed -i 's!redis://localhost:6379/0!$REDIS_STRING!g' config/config.yml
35+
&& sed -i 's!postgres\b!'"$DB_DIALECT"'!g' config/config.yml \
36+
&& sed -i 's!postgresql://user:password@host/dbname?sslmode=disable!'"$DB_CONNECTION_STRING"'!g' config/config.yml \
37+
&& sed -i 's!redis://localhost:6379/0!'"$REDIS_STRING"'!g' config/config.yml
3838

3939
# Install dependencies
4040
RUN glide install
4141

4242
# Build the app
43-
RUN go build -v -o sdb build_sdb.go
43+
RUN go build -o sdb build_sdb.go
4444

4545
RUN mkdir /output/ \
4646
&& mkdir /output/config \
@@ -54,7 +54,8 @@ FROM alpine
5454
WORKDIR /app
5555
COPY --from=builder /output/sdb /app/sdb
5656
COPY --from=builder /output/config.yml /app/config/config.yml
57+
RUN chmod +x /app/sdb
5758

58-
ENTRYPOINT ['./app/sdb']
59+
ENTRYPOINT ["/app/sdb"]
5960

6061
EXPOSE 5000

0 commit comments

Comments
 (0)
Please sign in to comment.