|
| 1 | +version: '3.5' |
| 2 | +services: |
| 3 | + server-template-ingress: |
| 4 | + container_name: server-template-ingress |
| 5 | + image: nginx:1.15-alpine |
| 6 | + restart: unless-stopped |
| 7 | + networks: |
| 8 | + - default |
| 9 | + ports: |
| 10 | + # __IMAGE_TAG__ |
| 11 | + - "__PORT__:80" |
| 12 | + volumes: |
| 13 | + - "./docker-nginx.conf:/etc/nginx/nginx.conf:delegated" |
| 14 | + - "./docker-nginx.htpasswd:/etc/nginx/.htpasswd:delegated" |
| 15 | + |
| 16 | + server-template-admin: |
| 17 | + container_name: server-template-admin |
| 18 | + build: |
| 19 | + context: ./admin |
| 20 | + dockerfile: ${dockerfile} |
| 21 | + restart: unless-stopped |
| 22 | + networks: |
| 23 | + - default |
| 24 | + ports: |
| 25 | + - "8080" |
| 26 | + volumes: |
| 27 | + - "./admin:/service:delegated" |
| 28 | + - "./shared:/service/shared:delegated" |
| 29 | + - "/service/node_modules" |
| 30 | + environment: |
| 31 | + COMMON_COMPANY: companyname |
| 32 | + COMMON_PROJECT: server-template |
| 33 | + |
| 34 | + server-template-client: |
| 35 | + container_name: server-template-client |
| 36 | + build: |
| 37 | + context: ./client |
| 38 | + dockerfile: ${dockerfile} |
| 39 | + restart: unless-stopped |
| 40 | + networks: |
| 41 | + - default |
| 42 | + ports: |
| 43 | + - "8080" |
| 44 | + volumes: |
| 45 | + - "./client:/service:delegated" |
| 46 | + - "./shared:/service/shared:delegated" |
| 47 | + - "/service/node_modules" |
| 48 | + secrets: |
| 49 | + # NOTE: Database connection is for tests only |
| 50 | + - DATABASE_PASSWORD |
| 51 | + - EXAMPLE_SECRET |
| 52 | + environment: |
| 53 | + COMMON_COMPANY: companyname |
| 54 | + COMMON_PROJECT: server-template |
| 55 | + # NOTE: Database connection is for tests only |
| 56 | + DATABASE_HOST: server-template-database |
| 57 | + DATABASE_NAME: server_template_local |
| 58 | + DATABASE_USER: server_template_local_app |
| 59 | + |
| 60 | + server-template-graphql: |
| 61 | + container_name: server-template-graphql |
| 62 | + build: |
| 63 | + context: ./graphql |
| 64 | + dockerfile: ${dockerfile} |
| 65 | + restart: unless-stopped |
| 66 | + networks: |
| 67 | + - default |
| 68 | + ports: |
| 69 | + - "8080" |
| 70 | + volumes: |
| 71 | + - "./graphql:/service:delegated" |
| 72 | + - "./shared:/service/shared:delegated" |
| 73 | + - "/service/node_modules" |
| 74 | + environment: |
| 75 | + COMMON_COMPANY: companyname |
| 76 | + COMMON_PROJECT: server-template |
| 77 | + COMMON_DOMAIN: localhost |
| 78 | + COMMON_URL: http://localhost:9999 |
| 79 | + COMMON_DEBUG: 'false' |
| 80 | + COMMON_LOG_FORMAT: text |
| 81 | + COMMON_LOG_LEVEL: info # trace, debug, info, warn, error, fatal |
| 82 | + COMMON_ENV: local |
| 83 | + DEBUG: 'false' |
| 84 | + GRAPHQL_PORT: 8080 |
| 85 | + GRAPHQL_BINDADDR: 0.0.0.0 |
| 86 | + API_HOST: server-template-server |
| 87 | + API_PORT: 8080 |
| 88 | + |
| 89 | + server-template-server: |
| 90 | + container_name: server-template-server |
| 91 | + build: |
| 92 | + context: ./server |
| 93 | + dockerfile: ${dockerfile} |
| 94 | + restart: unless-stopped |
| 95 | + networks: |
| 96 | + - default |
| 97 | + ports: |
| 98 | + - "8080" |
| 99 | + volumes: |
| 100 | + - "./server:/service:delegated" |
| 101 | + - "./shared:/service/shared:delegated" |
| 102 | + - "/service/node_modules" |
| 103 | + secrets: |
| 104 | + - DATABASE_PASSWORD |
| 105 | + - S3_KEY_SECRET |
| 106 | + - EXAMPLE_SECRET |
| 107 | + environment: |
| 108 | + COMMON_COMPANY: companyname |
| 109 | + COMMON_PROJECT: server-template |
| 110 | + COMMON_DEBUG: 'false' |
| 111 | + COMMON_LOG_FORMAT: text |
| 112 | + COMMON_LOG_LEVEL: info # trace, debug, info, warn, error, fatal |
| 113 | + COMMON_ENV: local |
| 114 | + DEBUG: 'false' |
| 115 | + SENTRY_DSN: #sentryDSN |
| 116 | + API_PORT: 8080 |
| 117 | + API_BINDADDR: 0.0.0.0 |
| 118 | + KAFKA_HOST: server-template-kafka |
| 119 | + KAFKA_PORT: 9092 |
| 120 | + DATABASE_HOST: server-template-database |
| 121 | + DATABASE_NAME: server_template_local |
| 122 | + DATABASE_USER: server_template_local_app |
| 123 | + DATABASE_POOL_MIN: '1' |
| 124 | + DATABASE_POOL_MAX: '10' |
| 125 | + S3_URL: http://server-template-storage:9000/ |
| 126 | + S3_REGION: milkyway |
| 127 | + S3_BUCKET: bucket |
| 128 | + S3_KEY_ID: minio |
| 129 | + |
| 130 | + server-template-www: |
| 131 | + container_name: server-template-www |
| 132 | + build: |
| 133 | + context: ./www |
| 134 | + dockerfile: ${dockerfile} |
| 135 | + restart: unless-stopped |
| 136 | + networks: |
| 137 | + - default |
| 138 | + ports: |
| 139 | + # TODO: Temporary hack for https://github.com/gatsbyjs/gatsby/issues/3721 |
| 140 | + - "7463:8080" |
| 141 | + volumes: |
| 142 | + - "./www:/service:delegated" |
| 143 | + - "/service/node_modules" |
| 144 | + - "/service/site/node_modules" |
| 145 | + # FOR GATSBY ONLY: |
| 146 | + # - "/service/site/node_modules" |
| 147 | + |
| 148 | + server-template-cache: |
| 149 | + container_name: server-template-cache |
| 150 | + image: redis:5.0-alpine |
| 151 | + restart: unless-stopped |
| 152 | + networks: |
| 153 | + - default |
| 154 | + ports: |
| 155 | + - "6379" |
| 156 | + |
| 157 | + server-template-kafka: |
| 158 | + container_name: server-template-kafka |
| 159 | + image: 'bitnami/kafka:latest' |
| 160 | + ports: |
| 161 | + - '9092' |
| 162 | + environment: |
| 163 | + - KAFKA_ZOOKEEPER_CONNECT=server-template-zookeeper:2181 |
| 164 | + - ALLOW_PLAINTEXT_LISTENER=yes |
| 165 | + |
| 166 | + server-template-zookeeper: |
| 167 | + container_name: server-template-zookeeper |
| 168 | + image: 'bitnami/zookeeper:latest' |
| 169 | + ports: |
| 170 | + - '2181' |
| 171 | + environment: |
| 172 | + - ALLOW_ANONYMOUS_LOGIN=yes |
| 173 | + |
| 174 | + # "EXTERNAL RESOURCES" |
| 175 | + |
| 176 | + server-template-database: |
| 177 | + container_name: server-template-database |
| 178 | + image: postgres:9.6 |
| 179 | + restart: unless-stopped |
| 180 | + networks: |
| 181 | + - default |
| 182 | + ports: |
| 183 | + - "6000:5432" |
| 184 | + secrets: |
| 185 | + - DATABASE_PASSWORD |
| 186 | + environment: |
| 187 | + POSTGRES_DB: server_template_local |
| 188 | + POSTGRES_USER: server_template_local_app |
| 189 | + POSTGRES_PASSWORD_FILE: /run/secrets/DATABASE_PASSWORD |
| 190 | + volumes: |
| 191 | + - "./database:/docker-entrypoint-initdb.d:delegated" |
| 192 | + |
| 193 | + server-template-storage: |
| 194 | + container_name: server-template-storage |
| 195 | + build: |
| 196 | + context: ./storage |
| 197 | + dockerfile: ${dockerfile} |
| 198 | + restart: unless-stopped |
| 199 | + command: server /service |
| 200 | + networks: |
| 201 | + - default |
| 202 | + ports: |
| 203 | + - "9000" |
| 204 | + secrets: |
| 205 | + - S3_KEY_SECRET |
| 206 | + environment: |
| 207 | + MINIO_ACCESS_KEY: minio |
| 208 | + # MINIO requires key as environment variable? |
| 209 | + MINIO_SECRET_KEY: secret1234 |
| 210 | + |
| 211 | +secrets: |
| 212 | + DATABASE_PASSWORD: |
| 213 | + file: ./secrets/${taito_env}/${db_database_name}-db-app.password |
| 214 | + S3_KEY_SECRET: |
| 215 | + file: ./secrets/${taito_env}/${taito_project}-${taito_env}-storage-gateway.secret |
| 216 | + EXAMPLE_SECRET: |
| 217 | + file: ./secrets/${taito_env}/${taito_project}-${taito_env}-example.secret |
| 218 | + |
| 219 | +networks: |
| 220 | + default: |
| 221 | + |
| 222 | +# EOF |
0 commit comments