Skip to content

Commit

Permalink
Dockerfile and compose
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenwf committed Nov 20, 2024
1 parent 1fe6a95 commit f8bdccd
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 2 deletions.
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ WORKDIR /home/node/app
ADD ./package.json /home/node/app/package.json
ADD ./yarn.lock /home/node/app/yarn.lock

RUN LDFLAGS='-static-libgcc -static-libstdc++' yarn install --production --no-interactive --frozen-lockfile
RUN yarn install --production --no-interactive --frozen-lockfile

FROM node:lts-bullseye-slim

Expand Down Expand Up @@ -56,4 +56,3 @@ COPY ./migrations /home/node/app/migrations
COPY ./config.json /home/node/app/config.json

CMD ["node_modules/.bin/pm2-runtime", "start", "./ecosystem.config.js", "--only", "tasks-api-prod"]

55 changes: 55 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
services:

gateway-redis:
image: redis:5-alpine

shared-postgres:
image: ghcr.io/digirati-co-uk/madoc-postgres:main
platform: linux/amd64
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres_password
- POSTGRES_MADOC_TS_USER=madoc_ts
- POSTGRES_MADOC_TS_SCHEMA=madoc_ts
- POSTGRES_MADOC_TS_PASSWORD=madoc_ts_password
- POSTGRES_TASKS_API_USER=tasks_api
- POSTGRES_TASKS_API_SCHEMA=tasks_api
- POSTGRES_TASKS_API_PASSWORD=tasks_api_password
- POSTGRES_MODELS_API_USER=models_api
- POSTGRES_MODELS_API_SCHEMA=models_api
- POSTGRES_MODELS_API_PASSWORD=models_api_password
- POSTGRES_CONFIG_SERVICE_USER=config_service
- POSTGRES_CONFIG_SERVICE_SCHEMA=config_service
- POSTGRES_CONFIG_SERVICE_PASSWORD=config_service_password
- POSTGRES_SEARCH_API_USER=search_api
- POSTGRES_SEARCH_API_SCHEMA=search_api
- POSTGRES_SEARCH_API_PASSWORD=search_api_password
volumes:
- shared_postgres_data:/var/lib/postgresql/data:Z
ports:
- "${PORTS_SHARED_POSTGRES:-5401}:5432"

tasks-api:
build:
dockerfile: Dockerfile
restart: on-failure
environment:
- SERVER_PORT=3000
- DATABASE_HOST=shared-postgres
- DATABASE_NAME=postgres
- DATABASE_PORT=5432
- DATABASE_USER=tasks_api
- DATABASE_SCHEMA=tasks_api
- DATABASE_PASSWORD=tasks_api_password
- QUEUE_LIST=tasks-api,madoc-ts
- REDIS_HOST=gateway-redis
links:
- shared-postgres
- gateway-redis
ports:
- "3000:3000"

volumes:
# Databases
shared_postgres_data: {}

0 comments on commit f8bdccd

Please sign in to comment.