Skip to content

Commit 2eea335

Browse files
Update docker-compose.yml to use a build context for postgres service (#77)
* Update docker-compose.yml to use a build context for postgres service * Add postgres service to the list of images in release.yml
1 parent e87633b commit 2eea335

File tree

6 files changed

+284498
-4
lines changed

6 files changed

+284498
-4
lines changed

.github/workflows/postgres.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: postgres
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths:
7+
- services/postgres/**
8+
workflow_dispatch:
9+
branches: [ main ]
10+
11+
defaults:
12+
run:
13+
working-directory: postgres
14+
15+
jobs:
16+
17+
build:
18+
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
25+
- name: Set up Docker Buildx
26+
uses: docker/setup-buildx-action@v3
27+
28+
- name: Login to ECR
29+
id: login-ecr
30+
uses: docker/login-action@v3
31+
with:
32+
registry: public.ecr.aws
33+
username: ${{ secrets.AWS_ACCESS_KEY_ID }}
34+
password: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
35+
36+
- name: Build and push
37+
uses: docker/build-push-action@v5
38+
with:
39+
context: ./services/postgres
40+
platforms: linux/amd64,linux/arm64
41+
push: true
42+
tags: ${{ secrets.PUBLIC_ECR_REGISTRY }}/storedog/postgres:latest
43+

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ jobs:
4545
${{ secrets.PUBLIC_ECR_REGISTRY }}/storedog/nginx
4646
${{ secrets.PUBLIC_ECR_REGISTRY }}/storedog/frontend
4747
${{ secrets.PUBLIC_ECR_REGISTRY }}/storedog/dbm
48+
${{ secrets.PUBLIC_ECR_REGISTRY }}/storedog/postgres
4849
)
4950
5051
for i in "${IMAGES[@]}"

docker-compose.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ services:
9595
ports:
9696
- '${DBM_PORT}:${DBM_PORT}'
9797
postgres:
98-
image: postgres:13-alpine
98+
build:
99+
context: ./services/postgres
99100
command: ['postgres', '-c', 'config_file=/postgresql.conf']
100101
restart: always
101102
depends_on:
@@ -112,9 +113,6 @@ services:
112113
- DD_LOGS_INJECTION=true
113114
- DD_RUNTIME_METRICS_ENABLED=true
114115
- DD_PROFILING_ENABLED=true
115-
volumes:
116-
- ./services/backend/db/restore:/docker-entrypoint-initdb.d
117-
- ./services/backend/db/postgresql.conf:/postgresql.conf
118116
labels:
119117
com.datadoghq.tags.env: '${DD_ENV}'
120118
com.datadoghq.tags.service: 'storedog-db'

services/postgres/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
FROM postgres:13-alpine
2+
COPY ./scripts/restore-2024-04-25-22-06-17.sql /docker-entrypoint-initdb.d/
3+
COPY ./postgresql.conf /postgresql.conf

0 commit comments

Comments
 (0)