Skip to content

Commit

Permalink
remove network mode host, add health check to postgres startup
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmcgaw committed Feb 12, 2023
1 parent 4748170 commit a841030
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 2 additions & 0 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ COPY LICENSE.md .

RUN go build -o /leapchat

EXPOSE 8080

CMD ["/leapchat"]
2 changes: 0 additions & 2 deletions Dockerfile.frontend.dev
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,4 @@ COPY webpack* .
COPY .env .
COPY .babelrc .

EXPOSE 5001

CMD ["npm", "run", "dev"]
14 changes: 8 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '3.1'
version: '3.4'

services:
frontend:
Expand All @@ -7,34 +7,35 @@ services:
dockerfile: ./Dockerfile.frontend.dev
ports:
- 5001:5001
network_mode: "host"
chatserver:
build:
context: .
dockerfile: ./Dockerfile.dev
ports:
- 8080:8080
network_mode: "host"
depends_on:
- postgrest
postgres:
image: postgres:latest
ports:
- 5432:5433
network_mode: "host"
environment:
- POSTGRES_PASSWORD=superuser
- POSTGRES_USER=superuser
- POSTGRES_DB=leapchat
volumes:
- ./_docker-volumes/postgres:/var/lib/postgresql/data
#- ./db:/docker-entrypoint-initdb.d/
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 5s
timeout: 60s
retries: 10
postgrest:
command: postgrest /app/postgrest.conf
image: postgrest/postgrest:latest
ports:
- 3000:3000
network_mode: "host"
environment:
PGUSER: superuser
PGPASSWORD: superuser
Expand All @@ -46,4 +47,5 @@ services:
volumes:
- ./db/:/app
depends_on:
- postgres
postgres:
condition: service_healthy

0 comments on commit a841030

Please sign in to comment.