This repository has been archived by the owner on Nov 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setup a Dockerfile for deployment (#26)
* setup dockerfile
- Loading branch information
1 parent
b035b6b
commit ce12d79
Showing
4 changed files
with
48 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Dockerfile | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
FROM openjdk:8u212-jdk-stretch AS builder | ||
|
||
RUN mkdir -p /opt/cassy | ||
WORKDIR /opt/cassy | ||
|
||
COPY gradle ./gradle | ||
COPY build.gradle ./ | ||
COPY gradlew ./gradlew | ||
COPY src ./src | ||
|
||
RUN ./gradlew installDist | ||
|
||
# Runtime Container | ||
FROM openjdk:8-alpine | ||
|
||
RUN apk add sqlite | ||
|
||
WORKDIR /opt/cassy | ||
|
||
RUN mkdir -p /cassy/data && mkdir -p /cassy/conf | ||
|
||
# Copy Build output from Builder Step | ||
COPY --from=builder /opt/cassy/build ./build | ||
COPY scripts ./scripts | ||
COPY conf ./conf | ||
|
||
RUN sqlite3 ./cassy.db < ./scripts/db.schema | ||
|
||
VOLUME /cassy | ||
|
||
ENTRYPOINT ["/bin/sh", "scripts/entrypoint.sh"] | ||
CMD ["--config", "/cassy/conf/backup-server.properties"] | ||
|
||
EXPOSE 20051 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/sh | ||
|
||
if [ ! -f /cassy/data/cassy.db ]; then | ||
cp cassy.db /cassy/data/; | ||
fi; | ||
|
||
if [ ! -f /cassy/conf/backup-server.properties ]; then | ||
cp conf/backup-server.properties /cassy/conf/; | ||
fi; | ||
|
||
build/install/cassy/bin/backup-server $@ |