Skip to content
This repository has been archived by the owner on Apr 7, 2022. It is now read-only.

Commit

Permalink
add dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
samwachspress committed May 5, 2021
1 parent fe794d9 commit 1315d92
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
54 changes: 54 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Use the offical golang image to create a binary.
# This is based on Debian and sets the GOPATH to /go.
# https://hub.docker.com/_/golang
FROM golang:1.16-buster as builder

# Create and change to the app directory.
WORKDIR /app

# Retrieve application dependencies.
# This allows the container build to reuse cached dependencies.
# Expecting to copy go.mod and if present go.sum.
COPY H2_script.R ./
COPY strain_data.tsv ./
COPY go.* ./
RUN go mod download

# Copy local code to the container image.
COPY . ./

# Build the binary.
RUN go build -v -o server


# build the deployed image
FROM continuumio/miniconda3

RUN apt-get update && apt-get install -y procps && \
apt-get clean
RUN conda config --add channels defaults && \
conda config --add channels bioconda && \
conda config --add channels conda-forge
RUN conda create -n heritability \
conda-forge::go=1.16.3 \
r=3.6.0 \
r-lme4 \
r-dplyr \
r-tidyr \
r-glue \
r-boot \
r-data.table \
r-futile.logger \
&& conda clean -a

LABEL Name="heritability" Author="Daniel Cook"
ENV PATH /opt/conda/envs/heritability/bin:$PATH
WORKDIR /app

# Copy local code to the container image.
COPY --from=builder /app/H2_script.R /app/H2_script.R
COPY --from=builder /app/strain_data.tsv /app/strain_data.tsv
COPY --from=builder /app/server /app/server

# Run the web service on container startup.
CMD ["/app/server"]
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This directory contains the code to start the Google Cloud Run Microservice for the Heritability Tool

Build using:

gcloud config set project andersen-lab
gcloud builds submit --config cloudbuild.yaml . --timeout=3h
gcloud run deploy --image gcr.io/andersen-lab/h2-1 --memory 1024Mi --platform managed h2-1 --timeout=15m

0 comments on commit 1315d92

Please sign in to comment.