From d2d5778c429ac891ae83ff3521d614028058fae3 Mon Sep 17 00:00:00 2001 From: orion Date: Thu, 26 Oct 2023 12:45:08 +0300 Subject: [PATCH] Add docker tools --- Dockerfile | 12 ++++++++++++ docker-compose.yml | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4e88db0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM node:18 +ARG UID=911 +ARG GID=911 + +WORKDIR /usr/share/dach +COPY package*.json ./ +COPY . . + +RUN npm install +USER dach +EXPOSE 1337 +ENTRYPOINT ["docker-entrypoint.sh"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..6563449 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,46 @@ +version: '3.8' + +services: + db: + image: postgres:12.1-alpine + container_name: dach_db + restart: always +# healthcheck: +# test: ["CMD", "pg_isready", "-U", "dach"] + environment: + POSTGRES_USER: dach + POSTGRES_PASSWORD: 0b45b85307c42f800e5755f3dee5189946a2d8b9 + POSTGRES_DB: dach + volumes: + - ./postgres:/var/lib/postgresql/data + + web: + container_name: dachan.fun + healthcheck: + test: + [ + "CMD-SHELL", + "wget -q --spider --proxy=off localhost:4000 || exit 1", + ] + restart: always + ports: + - '1337:1337' + build: + context: . + + # Feel free to remove or override this section + # See 'Build-time variables' in README.md + args: + - "UID=911" + - "GID=911" +# volumes: +# - ./uploads:/var/lib/pleroma/uploads + environment: + DOMAIN: dachan.fun + INSTANCE_NAME: DachChan + DB_USER: dach + DB_PASS: 0b45b85307c42f800e5755f3dee5189946a2d8b9 + DB_NAME: dach + depends_on: + - db +