Skip to content

Commit 0c61ed3

Browse files
committed
CF-4258: review comment changes
1 parent 7a7957e commit 0c61ed3

File tree

2 files changed

+74
-0
lines changed

2 files changed

+74
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Docker Build and Deploy
2+
3+
on:
4+
push:
5+
branches:
6+
- CF-4258-jaxB-linkbuilder #branch name which is used for image building
7+
8+
jobs:
9+
build:
10+
runs-on: self-hosted
11+
12+
env:
13+
ECR_REPOSITORY: atomhopper
14+
AWS_REGION: us-east-1
15+
16+
steps:
17+
- name: checkout code
18+
uses: actions/checkout@v3
19+
20+
- name: Set Short commit SHA as image tag
21+
run: echo "IMAGE_TAG=$(echo $GITHUB_SHA | cut -c1-7)" >> $GITHUB_ENV
22+
23+
- name: AWS ECR login
24+
run: |
25+
aws ecr get-login-password --region ${{ env.AWS_REGION }} | docker login --username AWS --password-stdin ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com
26+
27+
- name: Build docker image
28+
run: |
29+
docker build -f docker/Dockerfile --build-arg AH_VERSION=1.14.1-SNAPSHOT --build-arg SCHEMA_VERSION=1.139.1 --build-arg CATALOG_VERSION=1.138.4-SNAPSHOT -t ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }} .
30+
31+
- name: Push docker image to registry
32+
run: |
33+
docker push ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }}

docker-compose.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
version: '3.8'
2+
3+
services:
4+
postgres:
5+
image: postgres:13
6+
environment:
7+
POSTGRES_DB: atomhopper
8+
POSTGRES_USER: postgres
9+
POSTGRES_PASSWORD: password
10+
ports:
11+
- "5434:5432"
12+
volumes:
13+
- postgres_data:/var/lib/postgresql/data
14+
healthcheck:
15+
test: ["CMD-SHELL", "pg_isready -U postgres"]
16+
interval: 10s
17+
timeout: 5s
18+
retries: 5
19+
20+
atomhopper:
21+
build:
22+
context: .
23+
dockerfile: docker/Dockerfile
24+
ports:
25+
- "8081:8080"
26+
environment:
27+
DB_TYPE: PostgreSQL
28+
DB_DRIVER: org.postgresql.Driver
29+
DB_URL: jdbc:postgresql://postgres:5432/atomhopper
30+
DB_USER: postgres
31+
DB_PASSWORD: password
32+
DB_HOST: postgres:5432
33+
AH_EXTERNAL_DOMAIN: localhost:8081
34+
AH_EXTERNAL_SCHEME: http
35+
AH_DOMAIN_MODE: request-based
36+
depends_on:
37+
postgres:
38+
condition: service_healthy
39+
40+
volumes:
41+
postgres_data:

0 commit comments

Comments
 (0)