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 fbe66c5 commit 8630ef1
Show file tree
Hide file tree
Showing 9 changed files with 5,585 additions and 19,107 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@ static/lib/
_docker-volumes/

# Editors
.vscode/
.vscode/

# Mac OS X Bullshit
.DS_Store
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v14.0.0
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

RUN mkdir -p github.com/cryptag/leapchat/miniware

WORKDIR /app/github.com/cryptag/leapchat

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

RUN go build -o /leapchat

EXPOSE 8080

CMD ["/leapchat"]
15 changes: 15 additions & 0 deletions Dockerfile.frontend.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM node:14-alpine

WORKDIR /app

COPY package.json .
RUN npm install --legacy-peer-deps

COPY src/ /app/src
COPY test/ /app/test

COPY webpack* .
COPY .env .
COPY .babelrc .

CMD ["npm", "run", "dev"]
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
30 changes: 27 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,38 @@
version: '3.1'
version: '3.4'

services:
frontend:
build:
context: .
dockerfile: ./Dockerfile.frontend.dev
ports:
- 5001:5001
chatserver:
build:
context: .
dockerfile: ./Dockerfile.dev
ports:
- 8080:8080
depends_on:
- postgrest
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 +44,8 @@ services:
PGDATABASE: leapchat
PGSCHEMA: public
DB_ANON_ROLE: postgres
volumes:
- ./db/:/app
depends_on:
- postgres
postgres:
condition: service_healthy
Loading

0 comments on commit 8630ef1

Please sign in to comment.