Skip to content

Commit

Permalink
feat(docker): add Dockerfiles for services
Browse files Browse the repository at this point in the history
  • Loading branch information
jarali committed Nov 3, 2023
1 parent 031d67c commit 79b1838
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/http-proxy-service/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM golang:1.21-alpine

WORKDIR /app
COPY ./src/http-proxy-service ./src/http-proxy-service

WORKDIR /app/src/http-proxy-service
RUN go build -o ./main

EXPOSE 8080
CMD ["/app/src/http-proxy-service/main"]
12 changes: 12 additions & 0 deletions src/product-service/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM golang:1.21-alpine

WORKDIR /app
COPY ./lib ./lib
COPY ./src/product-service ./src/product-service

WORKDIR /app/src/product-service
RUN go mod tidy
RUN go build -o ./main

EXPOSE 3003
CMD ["/app/src/product-service/main"]
12 changes: 12 additions & 0 deletions src/shoppinglist-service/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM golang:1.21-alpine

WORKDIR /app
COPY ./lib ./lib
COPY ./src/shoppinglist-service ./src/shoppinglist-service

WORKDIR /app/src/shoppinglist-service
RUN go mod tidy
RUN go build -o ./main

EXPOSE 3002
CMD ["/app/src/shoppinglist-service/main"]
12 changes: 12 additions & 0 deletions src/user-service/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM golang:1.21-alpine

WORKDIR /app
COPY ./lib ./lib
COPY ./src/user-service ./src/user-service

WORKDIR /app/src/user-service
RUN go mod tidy
RUN go build -o ./main

EXPOSE 3003
CMD ["/app/src/user-service/main"]
15 changes: 15 additions & 0 deletions src/web-service/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM golang:1.21-alpine
RUN apk add --update nodejs npm

WORKDIR /app
COPY ./src/web-service ./src/web-service

WORKDIR /app/src/web-service/frontend
RUN npm ci
RUN npm run build

WORKDIR /app/src/web-service
RUN go build -o ./main

EXPOSE 3000
CMD ["/app/src/web-service/main"]

0 comments on commit 79b1838

Please sign in to comment.