Skip to content

Commit 30514f8

Browse files
author
elgris
committed
Fixed building auth-api, also started using docker caching for dependencies
1 parent ac70cef commit 30514f8

File tree

6 files changed

+23
-34
lines changed

6 files changed

+23
-34
lines changed

auth-api/Dockerfile

+10-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
1-
FROM ubuntu:latest
1+
FROM golang:1.9-alpine
2+
23
EXPOSE 8081
34

4-
RUN apt-get update -y && apt-get install curl -y && apt-get install golang -y && apt-get install git -y
5+
WORKDIR /go/src/app
6+
RUN apk --no-cache add curl git && \
7+
curl https://glide.sh/get | sh
58

6-
ENV GOPATH /usr
9+
COPY glide.* ./
10+
RUN glide install
711

8-
COPY . /auth-api
12+
COPY . .
13+
RUN go build -o auth-api
914

10-
CMD ["/auth-api/run.sh"]
15+
CMD /go/src/app/auth-api
1116

auth-api/run.sh

-8
This file was deleted.

frontend/Dockerfile

+2-5
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,9 @@ EXPOSE 8080
44

55
WORKDIR /usr/src/app
66

7-
COPY package.json index.html .* /usr/src/app/
7+
COPY package.json ./
88
RUN npm install
99

10-
COPY build/ /usr/src/app/build
11-
COPY config/ /usr/src/app/config
12-
COPY src/ /usr/src/app/src
13-
COPY static/ /usr/src/app/static
10+
COPY . .
1411

1512
CMD ["sh", "-c", "npm start" ]

todos-api/Dockerfile

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ EXPOSE 8082
44

55
WORKDIR /usr/src/app
66

7-
COPY package-lock.json package.json *.js /usr/src/app/
7+
COPY package.json ./
8+
RUN npm install
89

9-
RUN npm install && npm build
10+
COPY . .
1011

1112
CMD ["sh", "-c", "npm start" ]

users-api/Dockerfile

+8-9
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
FROM openjdk:8-alpine
22

33
EXPOSE 8083
4-
ENV MAVEN_VERSION 3.3.9
5-
ENV MAVEN_HOME /usr/lib/mvn
6-
ENV PATH $MAVEN_HOME/bin:$PATH
4+
WORKDIR /usr/src/app
75

8-
RUN wget http://archive.apache.org/dist/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz && \
9-
tar -zxvf apache-maven-$MAVEN_VERSION-bin.tar.gz && \
10-
rm apache-maven-$MAVEN_VERSION-bin.tar.gz && \
11-
mv apache-maven-$MAVEN_VERSION /usr/lib/mvn
126

13-
COPY . /tmp
7+
COPY pom.xml mvnw ./
8+
COPY .mvn/ ./.mvn
9+
RUN ./mvnw dependency:resolve
1410

15-
CMD ["/tmp/run.sh"]
11+
COPY . .
12+
RUN ./mvnw install
13+
14+
CMD ["java", "-jar", "./target/users-api-0.0.1-SNAPSHOT.jar"]

users-api/run.sh

-5
This file was deleted.

0 commit comments

Comments
 (0)