Commit 268e511a4baf04f5e8aeb2b844296fc4c75e8f0d
1 parent
1d6e1ea2
add cassandra schema initialization
Showing
3 changed files
with
30 additions
and
1 deletions
Dockerfile.cassandra
0 → 100644
1 | +FROM cassandra | |
2 | + | |
3 | +WORKDIR /opt/cassandra | |
4 | + | |
5 | +COPY dao/src/main/resources/cassandra/schema.cql /opt/cassandra | |
6 | +COPY entrypoint-with-db-init.sh /opt/cassandra/entrypoint-with-db-init.sh | |
7 | + | |
8 | +RUN chmod +x /opt/cassandra/entrypoint-with-db-init.sh | |
9 | + | |
10 | +ENTRYPOINT ["/opt/cassandra/entrypoint-with-db-init.sh"] | |
11 | +CMD ["cassandra", "-f"] | |
12 | + | ... | ... |
... | ... | @@ -20,6 +20,9 @@ services: |
20 | 20 | - "5432:5432" |
21 | 21 | |
22 | 22 | cassandra-tb: |
23 | + build: | |
24 | + context: . | |
25 | + dockerfile: Dockerfile.cassandra | |
23 | 26 | image: cassandra |
24 | 27 | networks: |
25 | 28 | - core |
... | ... | @@ -27,7 +30,9 @@ services: |
27 | 30 | - "7199:7199" |
28 | 31 | - "9160:9160" |
29 | 32 | - "9042:9042" |
30 | - | |
33 | + volumes: | |
34 | + - /cassandra:/var/lib/cassandra | |
35 | + - ./db-schema:/docker-entrypoint-initdb.d/ | |
31 | 36 | redis: |
32 | 37 | image: redis:4.0 |
33 | 38 | networks: | ... | ... |
entrypoint-with-db-init.sh
0 → 100644