Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions bookings/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# golang image where workspace (GOPATH) configured at /go.
FROM golang:1.11.2
FROM golang:1.11.2 as dev

# Install dependencies
RUN go get gopkg.in/mgo.v2
Expand All @@ -11,11 +11,17 @@ ADD . /go/src/github.com/mmorejon/cinema/bookings
# Setting up working directory
WORKDIR /go/src/github.com/mmorejon/cinema/bookings

# Build the bookings command inside the container.
RUN go install github.com/mmorejon/cinema/bookings
# build binary
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o bookings .

# Run the bookings microservice when the container starts.
ENTRYPOINT /go/bin/bookings

# alpine image
FROM alpine:3.9.2 as prod
# Setting up working directory
WORKDIR /root/
# copy movies binary
COPY --from=dev /go/src/github.com/mmorejon/cinema/bookings .
# Service listens on port 8080.
EXPOSE 8080
# Run the movies microservice when the container starts.
ENTRYPOINT ["./bookings"]
16 changes: 11 additions & 5 deletions movies/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# golang image where workspace (GOPATH) configured at /go.
FROM golang:1.11.2
FROM golang:1.11.2 as dev

# Install dependencies
RUN go get gopkg.in/mgo.v2
Expand All @@ -11,11 +11,17 @@ ADD . /go/src/github.com/mmorejon/cinema/movies
# Setting up working directory
WORKDIR /go/src/github.com/mmorejon/cinema/movies

# Build the movies command inside the container.
RUN go install github.com/mmorejon/cinema/movies
# build binary
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o movies .

# Run the movies microservice when the container starts.
ENTRYPOINT /go/bin/movies

# alpine image
FROM alpine:3.9.2 as prod
# Setting up working directory
WORKDIR /root/
# copy movies binary
COPY --from=dev /go/src/github.com/mmorejon/cinema/movies .
# Service listens on port 8080.
EXPOSE 8080
# Run the movies microservice when the container starts.
ENTRYPOINT ["./movies"]
16 changes: 11 additions & 5 deletions showtimes/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# golang image where workspace (GOPATH) configured at /go.
FROM golang:1.11.2
FROM golang:1.11.2 as dev

# Install dependencies
RUN go get gopkg.in/mgo.v2
Expand All @@ -11,11 +11,17 @@ ADD . /go/src/github.com/mmorejon/cinema/showtimes
# Setting up working directory
WORKDIR /go/src/github.com/mmorejon/cinema/showtimes

# Build the showtimes command inside the container.
RUN go install github.com/mmorejon/cinema/showtimes
# build binary
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o showtimes .

# Run the showtimes microservices when the container starts.
ENTRYPOINT /go/bin/showtimes

# alpine image
FROM alpine:3.9.2 as prod
# Setting up working directory
WORKDIR /root/
# copy movies binary
COPY --from=dev /go/src/github.com/mmorejon/cinema/showtimes .
# Service listens on port 8080.
EXPOSE 8080
# Run the movies microservice when the container starts.
ENTRYPOINT ["./showtimes"]
16 changes: 11 additions & 5 deletions users/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# golang image where workspace (GOPATH) configured at /go.
FROM golang:1.11.2
FROM golang:1.11.2 as dev

# Install dependencies
RUN go get gopkg.in/mgo.v2
Expand All @@ -11,11 +11,17 @@ ADD . /go/src/github.com/mmorejon/cinema/users
# Setting up working directory
WORKDIR /go/src/github.com/mmorejon/cinema/users

# Build the users command inside the container.
RUN go install github.com/mmorejon/cinema/users
# build binary
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o users .

# Run the users microservice when the container starts.
ENTRYPOINT /go/bin/users

# alpine image
FROM alpine:3.9.2 as prod
# Setting up working directory
WORKDIR /root/
# copy movies binary
COPY --from=dev /go/src/github.com/mmorejon/cinema/users .
# Service listens on port 8080.
EXPOSE 8080
# Run the movies microservice when the container starts.
ENTRYPOINT ["./users"]