Skip to content

Commit

Permalink
Updates to docker-compose file to build frontend and server, OOO on b…
Browse files Browse the repository at this point in the history
…ooting with dbs
  • Loading branch information
jimmcgaw committed Feb 13, 2023
1 parent 6ae8d3f commit 6d71631
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 3 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
18 changes: 18 additions & 0 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM golang:1.19-alpine

WORKDIR /app/github.com/cryptag/leapchat/miniware

WORKDIR /app/github.com/cryptag/leapchat

RUN mkdir -p /build

COPY miniware/* miniware/
COPY *.go .
COPY go.* .
COPY LICENSE.md .

RUN go build -o /leapchat

EXPOSE 8080

CMD ["/leapchat"]
18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

start:
docker compose up -d

stop:
docker compose down

restart:
docker compose restart

build:
docker compose build

buildup:
docker compose up -d --build

cleanv:
docker compose down -v
26 changes: 23 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,34 @@
version: '3.1'
version: '3.4'

services:
app:
build:
context: .
dockerfile: ./Dockerfile.dev
ports:
- 8080:8080
depends_on:
- postgrest
volumes:
- ./build:/build
postgres:
image: postgres:latest
ports:
- 127.0.0.1:5432:5432
- 5432:5433
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
Expand All @@ -23,5 +40,8 @@ services:
PGDATABASE: leapchat
PGSCHEMA: public
DB_ANON_ROLE: postgres
volumes:
- ./db/:/app
depends_on:
- postgres
postgres:
condition: service_healthy

0 comments on commit 6d71631

Please sign in to comment.