Skip to content

Commit

Permalink
chore: prepare docker compose
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Kühnlein committed Feb 1, 2024
1 parent fbafc31 commit 02f32c0
Show file tree
Hide file tree
Showing 5 changed files with 121 additions and 85 deletions.
5 changes: 3 additions & 2 deletions .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ TEMPORAL_UI_VERSION=2.21.0
POSTGRESQL_VERSION=13
POSTGRES_PASSWORD=temporal
POSTGRES_USER=temporal
POSTGRES_DEFAULT_PORT=5432
MINIO_VERSION=latest
MINIO_ROOT_USER=minioadmin
MINIO_ROOT_PASSWORD=minioadmin
MINIO_ROOT_PASSWORD=minioadmin
MONGO_ROOT_USER=mongoroot
MONGO_ROOT_PASSWORD=mongoroot
8 changes: 8 additions & 0 deletions app/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Dockerfile
.dockerignore
node_modules
npm-debug.log
README.md
.next
.git
.env
1 change: 1 addition & 0 deletions app/.env.local.template
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
MINIO_HOST=localhost
MINIO_ACCESS_KEY=
MINIO_SECRET_KEY=
MONGO_URL=
API_URL=http://localhost:3000
64 changes: 64 additions & 0 deletions docker-compose.base.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# base file for dev and prod deployments
services:
app:
image: ghcr.io/jank1310/datadolphin:latest
command: node /app/nextjs/server.js
restart: always
ports:
- 3000:3000
# Set environment variables directly in the docker-compose file
environment:
ENV_VARIABLE: ${ENV_VARIABLE}
NEXT_PUBLIC_ENV_VARIABLE: ${NEXT_PUBLIC_ENV_VARIABLE}
worker:
image: ghcr.io/jank1310/datadolphin:latest
command: node /app/worker/worker.js
restart:
always
# Set environment variables directly in the docker-compose file
environment:
ENV_VARIABLE: ${ENV_VARIABLE}
NEXT_PUBLIC_ENV_VARIABLE: ${NEXT_PUBLIC_ENV_VARIABLE}
# STORAGE
minio:
image: minio/minio:${MINIO_VERSION}
command: server --console-address ":9001" /data
ports:
- "9000:9000"
- "9001:9001"
hostname: minio
healthcheck:
test: ["CMD", "mc", "ready", "local"]
interval: 5s
timeout: 5s
retries: 5
mongodb:
container_name: mongodb
image: mongo
restart: always
ports:
- 27017:27017
temporal-postgresql:
container_name: temporal-postgresql
image: postgres:${POSTGRESQL_VERSION}
expose:
- 5432
volumes:
- postgresql:/var/lib/postgresql/data
# TEMPORAL
temporal:
container_name: temporal
depends_on:
- temporal-postgresql
image: temporalio/auto-setup:${TEMPORAL_VERSION}
ports:
- 7233:7233
volumes:
- ./dynamicconfig:/etc/temporal/config/dynamicconfig
temporal-ui:
container_name: temporal-ui
depends_on:
- temporal
image: temporalio/ui:${TEMPORAL_UI_VERSION}
ports:
- 8080:8080
128 changes: 45 additions & 83 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,113 +1,75 @@
version: "3.7"

services:
app:
extends:
file: docker-compose.yml
service: app
worker-1:
extends:
file: docker-compose.yml
service: worker
worker-2:
extends:
file: docker-compose.yml
service: worker
worker-3:
extends:
file: docker-compose.yml
service: worker
# STORAGE
minio:
image: minio/minio:${MINIO_VERSION}
command: server --console-address ":9001" /data
ports:
- "9000:9000"
- "9001:9001"
extends:
file: docker-compose.yml
service: minio
environment:
MINIO_ROOT_USER: ${MINIO_ROOT_USER}
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD}
hostname: minio
volumes:
- miniostorage:/data
healthcheck:
test: ["CMD", "mc", "ready", "local"]
interval: 5s
timeout: 5s
retries: 5
postgresql:
container_name: temporal-postgresql
temporal-postgresql:
extends:
file: docker-compose.yml
service: temporal-postgresql
environment:
POSTGRES_PASSWORD: temporal
POSTGRES_USER: temporal
image: postgres:${POSTGRESQL_VERSION}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
networks:
- temporal-network
expose:
- 5432
volumes:
- postgresql:/var/lib/postgresql/data
# postgresql-ferretdb:
# container_name: ferretdb-postgresql
# environment:
# POSTGRES_PASSWORD: ferretdb
# POSTGRES_USER: ferretdb
# POSTGRES_DB: ferretdb
# image: postgres:${POSTGRESQL_VERSION}
# networks:
# - ferretdb-network
# expose:
# - 5432
# volumes:
# - postgresql-ferretdb:/var/lib/postgresql/data
# ferretdb:
# container_name: ferretdb
# depends_on:
# - postgresql
# image: ghcr.io/ferretdb/ferretdb
# restart: on-failure
# ports:
# - 27017:27017
# environment:
# - FERRETDB_POSTGRESQL_URL=postgres://ferretdb:ferretdb@postgresql-ferretdb:5432/ferretdb
# networks:
# - ferretdb-network
mongodb:
container_name: mongodb
image: mongo
restart: always
extends:
file: docker-compose.yml
service: mongodb
environment:
MONGO_INITDB_ROOT_USERNAME: datadolphin
MONGO_INITDB_ROOT_PASSWORD: datadolphin
ports:
- 27017:27017
MONGO_INITDB_ROOT_USERNAME: ${MONGO_ROOT_USER}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_ROOT_PASSWORD}
volumes:
- mongodb:/data/db
# TEMPORAL
temporal:
extends:
file: docker-compose.yml
service: temporal
networks:
- temporal-network
temporal:
container_name: temporal
depends_on:
- postgresql
environment:
- DB=postgresql
- DB_PORT=5432
- POSTGRES_USER=temporal
- POSTGRES_PWD=temporal
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PWD=${POSTGRES_PASSWORD}
- POSTGRES_SEEDS=postgresql
- DYNAMIC_CONFIG_FILE_PATH=config/dynamicconfig/development.yaml
image: temporalio/auto-setup:${TEMPORAL_VERSION}
networks:
- temporal-network
ports:
- 7233:7233
volumes:
- ./dynamicconfig:/etc/temporal/config/dynamicconfig
temporal-admin-tools:
container_name: temporal-admin-tools
depends_on:
- temporal
environment:
- TEMPORAL_ADDRESS=temporal:7233
- TEMPORAL_CLI_ADDRESS=temporal:7233
image: temporalio/admin-tools:${TEMPORAL_VERSION}
networks:
- temporal-network
stdin_open: true
tty: true
temporal-ui:
container_name: temporal-ui
depends_on:
- temporal
extends:
file: docker-compose.yml
service: temporal-ui
environment:
- TEMPORAL_ADDRESS=temporal:7233
- TEMPORAL_CORS_ORIGINS=http://localhost:3000
image: temporalio/ui:${TEMPORAL_UI_VERSION}
networks:
- temporal-network
ports:
- 8080:8080
networks:
temporal-network:
driver: bridge
Expand All @@ -117,5 +79,5 @@ networks:
name: ferretdb-network
volumes:
miniostorage:
postgresql:
postgresql-ferretdb:
temporal-postgresql:
mongodb:

0 comments on commit 02f32c0

Please sign in to comment.