Skip to content

Commit 6d71631

Browse files
committed
Updates to docker-compose file to build frontend and server, OOO on booting with dbs
1 parent 6ae8d3f commit 6d71631

File tree

4 files changed

+60
-3
lines changed

4 files changed

+60
-3
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules/

Dockerfile.dev

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM golang:1.19-alpine
2+
3+
WORKDIR /app/github.com/cryptag/leapchat/miniware
4+
5+
WORKDIR /app/github.com/cryptag/leapchat
6+
7+
RUN mkdir -p /build
8+
9+
COPY miniware/* miniware/
10+
COPY *.go .
11+
COPY go.* .
12+
COPY LICENSE.md .
13+
14+
RUN go build -o /leapchat
15+
16+
EXPOSE 8080
17+
18+
CMD ["/leapchat"]

Makefile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
start:
3+
docker compose up -d
4+
5+
stop:
6+
docker compose down
7+
8+
restart:
9+
docker compose restart
10+
11+
build:
12+
docker compose build
13+
14+
buildup:
15+
docker compose up -d --build
16+
17+
cleanv:
18+
docker compose down -v

docker-compose.yml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,34 @@
1-
version: '3.1'
1+
version: '3.4'
22

33
services:
4+
app:
5+
build:
6+
context: .
7+
dockerfile: ./Dockerfile.dev
8+
ports:
9+
- 8080:8080
10+
depends_on:
11+
- postgrest
12+
volumes:
13+
- ./build:/build
414
postgres:
515
image: postgres:latest
616
ports:
7-
- 127.0.0.1:5432:5432
17+
- 5432:5433
818
environment:
919
- POSTGRES_PASSWORD=superuser
1020
- POSTGRES_USER=superuser
1121
- POSTGRES_DB=leapchat
1222
volumes:
1323
- ./_docker-volumes/postgres:/var/lib/postgresql/data
24+
#- ./db:/docker-entrypoint-initdb.d/
25+
healthcheck:
26+
test: ["CMD-SHELL", "pg_isready"]
27+
interval: 5s
28+
timeout: 60s
29+
retries: 10
1430
postgrest:
31+
command: postgrest /app/postgrest.conf
1532
image: postgrest/postgrest:latest
1633
ports:
1734
- 3000:3000
@@ -23,5 +40,8 @@ services:
2340
PGDATABASE: leapchat
2441
PGSCHEMA: public
2542
DB_ANON_ROLE: postgres
43+
volumes:
44+
- ./db/:/app
2645
depends_on:
27-
- postgres
46+
postgres:
47+
condition: service_healthy

0 commit comments

Comments
 (0)