Skip to content

Instantly share code, notes, and snippets.

@fakhrulhilal
Created August 18, 2023 03:13
Show Gist options
  • Save fakhrulhilal/882008133a57ab3f6027e90799e647d6 to your computer and use it in GitHub Desktop.
Save fakhrulhilal/882008133a57ab3f6027e90799e647d6 to your computer and use it in GitHub Desktop.
A docker compose for running multiple services and joining into global private net
version: "3.9"
name: common-services
services:
dbserver:
image: mcr.microsoft.com/mssql/server:2022-latest
container_name: mssql
ports:
- "1433:1433"
networks:
- labnet
volumes:
- sqlvolume:/var/opt/mssql
environment:
ACCEPT_EULA: Y
MSSQL_SA_PASSWORD: "${DB_PASSWORD}"
MSSQL_MEMORY_LIMIT_MB: 2048
MSSQL_AGENT_ENABLED: true
TZ: Asia/Jakarta
persistentserver:
image: mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator
container_name: cosmos
mem_limit: 3GB
ports:
- "8081:8081"
- "10250-10255:10250-10255"
volumes:
- ${CERT_DIR}:/certs
# volumes:
# - type: bind
# source: 'D:\Aplikasi\certificates\domain.cert.pfx'
# target: /tmp/cosmos/appdata/.system/profiles/client/appdata/local/cosmosdbemulator/default.sslcert.pfx
# read_only: true
environment:
AZURE_COSMOS_EMULATOR_PARTITION_COUNT: 3
AZURE_COSMOS_EMULATOR_ENABLE_DATA_PERSISTENCE: true
AZURE_COSMOS_EMULATOR_KEY: ${AZ_COSMOS_KEY}
AZURE_COSMOS_EMULATOR_CERTIFICATE: ${AZ_COSMOS_CERTIFICATE}
storageserver:
image: mcr.microsoft.com/azure-storage/azurite:3.24.0
container_name: azurite
networks:
- labnet
volumes:
- blobvolume:/data
ports:
- "10000:10000"
- "10001:10001"
- "10002:10002"
command: ["azurite", "--blobHost", "0.0.0.0", "--queueHost", "0.0.0.0", "--tableHost", "0.0.0.0", "--skipApiVersionCheck"]
mailserver:
image: rnwood/smtp4dev
container_name: rnwood-smtp
ports:
- "8025:80"
- "44325:443"
- "25:25"
networks:
- labnet
volumes:
- ${CERT_DIR}:/certs
environment:
ASPNETCORE_URLS: "https://+:443;http://+:80"
ASPNETCORE_Kestrel__Certificates__Default__Path: "${CERT_PATH}"
ASPNETCORE_Kestrel__Certificates__Default__Password: "${CERT_PASSWORD}"
logserver:
image: datalust/seq:latest
container_name: seq-log
ports:
- "8041:80"
- "5341:5341"
restart: on-failure
environment:
ACCEPT_EULA: "Y"
volumes:
- logdata:/data
networks:
- labnet
healthcheck:
test: curl -s -f http://localhost:5341 || exit 1
interval: 30s
timeout: 5s
retries: 3
cacheserver:
image: redis
container_name: redis-cache
ports:
- "6379:6379"
networks:
- labnet
healthcheck:
test: if ping="$$(redis-cli -h localhost ping)" && [ "$$ping" = 'PONG' ]; then exit 0; else exit 1; fi
interval: 30s
timeout: 5s
retries: 3
netserver:
image: zerotier/zerotier:latest
container_name: zerotier
hostname: zerotier_client
privileged: true
volumes:
- netvolume:/var/lib/zerotier-one
environment:
ZEROTIER_JOIN_NETWORKS: ${ZEROTIER_NETID}
networks:
- labnet
cap_add:
- NET_ADMIN
- SYS_ADMIN
devices:
- /dev/net/tun
volumes:
logdata:
sqlvolume:
blobvolume:
netvolume:
networks:
labnet:
external: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment