Skip to content

Commit

Permalink
[risk=no] adding docker file in deploy (#1107)
Browse files Browse the repository at this point in the history
* adding docker file in deploy

* installing sudo on docker

* installing sudo on docker

Co-authored-by: Srushti Gangireddy <[email protected]>
  • Loading branch information
SrushtiGangireddy and Srushti Gangireddy authored Aug 17, 2022
1 parent 41bc821 commit 230b1ca
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 10 deletions.
51 changes: 51 additions & 0 deletions deploy/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Image used for deployment. The Circle image is not used here as it does not
# have an ARM build (M1 chip requires emulation).
# Keep synchronized with ci/Dockerfile.circle_build
FROM openjdk:8-buster

RUN apt-get update \
&& apt-get install --no-install-recommends -yq \
gettext \
ruby \
default-mysql-client \
python3 \
python3-pip \
nodejs \
npm \
wait-for-it \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

RUN apt-get update && \
apt-get -y install sudo

RUN npm install --global yarn n
# Upgrade to Node 16, above installs 10.
RUN n 16

ENV CLOUD_SDK_VERSION 392.0.0

WORKDIR /root
RUN wget https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-${CLOUD_SDK_VERSION}-linux-x86_64.tar.gz -O gcloud.tgz && \
tar -xf gcloud.tgz && \
./google-cloud-sdk/install.sh --quiet && \
./google-cloud-sdk/bin/gcloud components install app-engine-java && \
rm -rf gcloud.tgz

ENV PATH=~/node/bin:~/google-cloud-sdk/bin:$PATH

RUN wget https://dl.google.com/cloudsql/cloud_sql_proxy.linux.amd64 -O /tmp/cloud_sql_proxy \
&& mv /tmp/cloud_sql_proxy /usr/local/bin && chmod +x /usr/local/bin/cloud_sql_proxy

# It never makes sense for Gradle to run a daemon within a docker container.
ENV GRADLE_OPTS="-Dorg.gradle.daemon=false"

ENV GRADLE_VERSION 6.7.1

RUN wget "https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip" -O /tmp/gradle.zip \
&& unzip /tmp/gradle.zip -d /opt/gradle
ENV PATH="/opt/gradle/gradle-${GRADLE_VERSION}/bin:${PATH}"

# Force a lower concurrent-ruby version, as we only have Ruby 2.3.
RUN gem install activesupport -v 6.1.4.6
RUN gem install jira-ruby
8 changes: 0 additions & 8 deletions deploy/bootstrap-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,8 @@ if [[ -z "${DATA_BROWSER_VERSION}" ]]; then
exit 1
fi

# Coerce some of the volume permissions to be available to our docker user
# "circleci" (group "circleci"). Use group for this creds file as the calling
# script will want to maintain ownership to delete it afterwards.
sudo chgrp circleci /creds/sa-key.json
sudo chmod g+r /creds/sa-key.json
sudo chown -R circleci /.gradle

if [[ ! -d ~/data-browser/.git ]]; then
sudo git clone https://github.com/all-of-us/data-browser ~/data-browser
sudo chown -R circleci ~/data-browser
fi
cd ~/data-browser

Expand Down
4 changes: 2 additions & 2 deletions deploy/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
version: "3"
services:
deploy:
image: allofustest/workbench:buildimage-0.0.19
build:
context: .
entrypoint: /bootstrap-docker.sh
user: circleci
environment:
# Required: a GitHub release git tag, e.g. v1-0-rc1
- DATA_BROWSER_VERSION
Expand Down

0 comments on commit 230b1ca

Please sign in to comment.