Skip to content

Commit

Permalink
Update docker-compose.yml to use a build context for postgres service (
Browse files Browse the repository at this point in the history
…#77)

* Update docker-compose.yml to use a build context for postgres service

* Add postgres service to the list of images in release.yml
  • Loading branch information
stanleegoodspeed authored May 9, 2024
1 parent e87633b commit 2eea335
Show file tree
Hide file tree
Showing 6 changed files with 284,498 additions and 4 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/postgres.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: postgres

on:
push:
branches: [ main ]
paths:
- services/postgres/**
workflow_dispatch:
branches: [ main ]

defaults:
run:
working-directory: postgres

jobs:

build:

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to ECR
id: login-ecr
uses: docker/login-action@v3
with:
registry: public.ecr.aws
username: ${{ secrets.AWS_ACCESS_KEY_ID }}
password: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

- name: Build and push
uses: docker/build-push-action@v5
with:
context: ./services/postgres
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ secrets.PUBLIC_ECR_REGISTRY }}/storedog/postgres:latest

1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:
${{ secrets.PUBLIC_ECR_REGISTRY }}/storedog/nginx
${{ secrets.PUBLIC_ECR_REGISTRY }}/storedog/frontend
${{ secrets.PUBLIC_ECR_REGISTRY }}/storedog/dbm
${{ secrets.PUBLIC_ECR_REGISTRY }}/storedog/postgres
)
for i in "${IMAGES[@]}"
Expand Down
6 changes: 2 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ services:
ports:
- '${DBM_PORT}:${DBM_PORT}'
postgres:
image: postgres:13-alpine
build:
context: ./services/postgres
command: ['postgres', '-c', 'config_file=/postgresql.conf']
restart: always
depends_on:
Expand All @@ -112,9 +113,6 @@ services:
- DD_LOGS_INJECTION=true
- DD_RUNTIME_METRICS_ENABLED=true
- DD_PROFILING_ENABLED=true
volumes:
- ./services/backend/db/restore:/docker-entrypoint-initdb.d
- ./services/backend/db/postgresql.conf:/postgresql.conf
labels:
com.datadoghq.tags.env: '${DD_ENV}'
com.datadoghq.tags.service: 'storedog-db'
Expand Down
3 changes: 3 additions & 0 deletions services/postgres/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM postgres:13-alpine
COPY ./scripts/restore-2024-04-25-22-06-17.sql /docker-entrypoint-initdb.d/
COPY ./postgresql.conf /postgresql.conf
Loading

0 comments on commit 2eea335

Please sign in to comment.