Skip to content

Commit

Permalink
#463 updated dockerfile to build image all inside container. updated …
Browse files Browse the repository at this point in the history
…cirlce config
  • Loading branch information
tuxranger committed Mar 18, 2021
1 parent 7bc6ea9 commit ae55e83
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 13 deletions.
13 changes: 6 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ jobs:
steps:
- checkout

- run:
name: Running Unit Tests
command: |
echo "Running unit tests and building binary"
# - run:
# name: Running Unit Tests
# command: |
# echo "Running unit tests and building binary"
# go mod download
# make all
- run:
name: Running Integration Test and Push Images
name: Build and Push Images
command: |
echo "Logging in to Docker Hub"
docker login --username ${DOCKERHUB_USERNAME} --password ${DOCKERHUB_PASSWORD}
Expand All @@ -27,8 +27,7 @@ jobs:
echo $IMAGE_NAME
echo "Building Service Image"
cd dist
docker build -f ../Dockerfile -t ${IMAGE_NAME} -t motivlabs/janus:latest .
docker build -f ./Dockerfile --target=prod -t ${IMAGE_NAME} -t motivlabs/janus:latest .
echo "Finished Building Service Image"
echo "Pushing Service Images to Docker Hub"
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ _book
node_modules/

# HF config files
/dist/janus
/dist
debug
17 changes: 13 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
# run this from the dist folder of janus after running make build or make all
FROM ubuntu:20.04
####### Start from a golang base image ###############
FROM golang:1.13.6-buster as builder
LABEL maintainer="Motiv Labs <dev@motivsolutions.com>"
WORKDIR /app
COPY ./ ./

COPY schema.sql /usr/local/bin
RUN go mod download

ADD janus /bin/janus
RUN make build

FROM ubuntu:20.04 as prod

COPY --from=builder /app/cassandra/schema.sql /usr/local/bin

COPY --from=builder /app/dist/janus /bin/janus
RUN chmod a+x /bin/janus && \
mkdir -p /etc/janus/apis && \
mkdir -p /etc/janus/auth
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ HEALTHCHECK --interval=5s --timeout=5s --retries=3 CMD curl -f http://localhost:
FROM build-debug-common as dev
EXPOSE 8080 8081 8443 8444 40000
COPY entry-dev.sh /usr/local/bin
COPY dist/schema.sql /usr/local/bin
COPY cassandra/schema.sql /usr/local/bin
RUN chmod 755 /usr/local/bin/entry-dev.sh
ENTRYPOINT ["/usr/local/bin/entry-dev.sh"]
#ENTRYPOINT ["/janus", "start"]
File renamed without changes.

0 comments on commit ae55e83

Please sign in to comment.