From fc564634dedc61c9cf1c185bc4e8dff7c29805ef Mon Sep 17 00:00:00 2001 From: syui Date: Wed, 21 Feb 2024 23:03:24 +0900 Subject: [PATCH] add docker --- .gitignore | 2 -- Dockerfile | 14 ++++++++++++++ app/data/new.sqlite | 0 compose.yml | 11 +++++++++++ 4 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 Dockerfile create mode 100644 app/data/new.sqlite create mode 100644 compose.yml diff --git a/.gitignore b/.gitignore index b5feb04..d46cb26 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,6 @@ t .env *.json -*.sqlite -#*.zsh tmp/card_limit.zsh tmp/card_day.zsh tmp/card_delete.zsh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6e3abfb --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +FROM syui/aios + +WORKDIR /app +RUN git clone https://git.syui.ai/ai/api tmp + +WORKDIR /app/tmp +RUN go build +RUN mv api /app/api + +WORKDIR /app/data +RUN touch /app/data/new.sqlite + +WORKDIR /app +ENTRYPOINT ["/app/api"] diff --git a/app/data/new.sqlite b/app/data/new.sqlite new file mode 100644 index 0000000..e69de29 diff --git a/compose.yml b/compose.yml new file mode 100644 index 0000000..a16ec3c --- /dev/null +++ b/compose.yml @@ -0,0 +1,11 @@ +services: + api: + ports: + - 8080:8080 + build: + context: . + restart: always + env_file: + - .env + volumes: + - ./app/data:/app/data