Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add docker-compose, update Dockerfile #11

Merged
merged 1 commit into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.git
.gradle
6 changes: 5 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,8 @@ disabled_rules=no-wildcard-imports,no-unused-imports

[{*.kt,*.kts}]
ij_kotlin_allow_trailing_comma = true
ij_kotlin_code_style_defaults = KOTLIN_OFFICIAL
ij_kotlin_code_style_defaults = KOTLIN_OFFICIAL

[*.yaml]
indent_size = 2
indent_style = space
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM gradle:7-jdk11 AS build
FROM gradle:8-jdk11-alpine AS build
COPY --chown=gradle:gradle . /home/gradle/src
WORKDIR /home/gradle/src
RUN gradle shadowJar --no-daemon
Expand All @@ -7,4 +7,4 @@ FROM openjdk:11
EXPOSE 8080:8080
RUN mkdir /app
COPY --from=build /home/gradle/src/build/libs/*-all.jar /app/kotatsu-syncserver.jar
ENTRYPOINT ["java","-jar","/app/kotatsu-syncserver.jar"]
ENTRYPOINT ["java","-jar","/app/kotatsu-syncserver.jar"]
30 changes: 30 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
services:
db:
image: mysql:8.0-debian
environment:
MYSQL_USER: your_user
MYSQL_PASSWORD: your_password
MYSQL_DATABASE: kotatsu_db
MYSQL_ALLOW_EMPTY_PASSWORD: true
volumes:
- /var/lib/mysql:/var/lib/mysql
ports:
- "3306:3306"
server:
container_name: kotatsu-sync
build: ./
depends_on:
- db
links:
- db
ports:
- "8081:8080"
environment:
DATABASE_HOST: db
DATABASE_USER: your_user
DATABASE_PASSWORD: your_password
DATABASE_NAME: kotatsu_db
DATABASE_PORT: 3306
JWT_SECRET: your_secret
ALLOW_NEW_REGISTER: true
restart: always