From 2320c6c4d5edc77f8c84f3a23fb1b807e7747325 Mon Sep 17 00:00:00 2001 From: drgns-wtd <137842227+drgns-wtd@users.noreply.github.com> Date: Sat, 14 Oct 2023 12:03:51 +0000 Subject: [PATCH] feat: add docker support with redis(#118) --- Dockerfile | 11 +++++++++++ docker-compose.yml | 20 ++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e5a1e26 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM node:alpine3.17 +WORKDIR /app + +RUN apk update && apk add git +RUN git clone https://github.com/zyachel/quetre . +RUN npm i -g pnpm +RUN pnpm install + +EXPOSE 3000 + +CMD ["pnpm", "start"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..f130144 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,20 @@ +version: '3' + +services: + quetre: + build: + context: . + dockerfile: Dockerfile + restart: unless-stopped + ports: + - "3000:3000" + environment: + - "NODE_ENV=production" + - "PORT=3000" + - "CACHE_PERIOD=1h" + - "REDIS_URL=redis:6379" # optional + - "REDIS_TTL=3600" + redis: + image: docker.io/redis:alpine + container_name: redis + restart: unless-stopped \ No newline at end of file