Skip to content

Commit 8630ef1

Browse files
committed
Updates to docker-compose file to build frontend and server, OOO on booting with dbs
1 parent fbe66c5 commit 8630ef1

File tree

9 files changed

+5585
-19107
lines changed

9 files changed

+5585
-19107
lines changed

.dockerignore

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

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,7 @@ static/lib/
1010
_docker-volumes/
1111

1212
# Editors
13-
.vscode/
13+
.vscode/
14+
15+
# Mac OS X Bullshit
16+
.DS_Store

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v14.0.0

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
4+
5+
RUN mkdir -p github.com/cryptag/leapchat/miniware
6+
7+
WORKDIR /app/github.com/cryptag/leapchat
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"]

Dockerfile.frontend.dev

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM node:14-alpine
2+
3+
WORKDIR /app
4+
5+
COPY package.json .
6+
RUN npm install --legacy-peer-deps
7+
8+
COPY src/ /app/src
9+
COPY test/ /app/test
10+
11+
COPY webpack* .
12+
COPY .env .
13+
COPY .babelrc .
14+
15+
CMD ["npm", "run", "dev"]

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: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,38 @@
1-
version: '3.1'
1+
version: '3.4'
22

33
services:
4+
frontend:
5+
build:
6+
context: .
7+
dockerfile: ./Dockerfile.frontend.dev
8+
ports:
9+
- 5001:5001
10+
chatserver:
11+
build:
12+
context: .
13+
dockerfile: ./Dockerfile.dev
14+
ports:
15+
- 8080:8080
16+
depends_on:
17+
- postgrest
418
postgres:
519
image: postgres:latest
620
ports:
7-
- 127.0.0.1:5432:5432
21+
- 5432:5433
822
environment:
923
- POSTGRES_PASSWORD=superuser
1024
- POSTGRES_USER=superuser
1125
- POSTGRES_DB=leapchat
1226
volumes:
1327
- ./_docker-volumes/postgres:/var/lib/postgresql/data
28+
#- ./db:/docker-entrypoint-initdb.d/
29+
healthcheck:
30+
test: ["CMD-SHELL", "pg_isready"]
31+
interval: 5s
32+
timeout: 60s
33+
retries: 10
1434
postgrest:
35+
command: postgrest /app/postgrest.conf
1536
image: postgrest/postgrest:latest
1637
ports:
1738
- 3000:3000
@@ -23,5 +44,8 @@ services:
2344
PGDATABASE: leapchat
2445
PGSCHEMA: public
2546
DB_ANON_ROLE: postgres
47+
volumes:
48+
- ./db/:/app
2649
depends_on:
27-
- postgres
50+
postgres:
51+
condition: service_healthy

0 commit comments

Comments
 (0)