From ba140f05d338500113c0417c9bfff4c53811e1bb Mon Sep 17 00:00:00 2001 From: Ali BARIN Date: Wed, 31 Aug 2022 16:34:15 +0200 Subject: [PATCH] chore: add docker-compose support --- Dockerfile | 18 ++++++++++++++++++ docker-compose.yml | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..e055b542 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +# syntax=docker/dockerfile:1 +FROM node:16 +WORKDIR /automatisch + +# npm registry for dev purposes +RUN npm config set fetch-retry-maxtimeout 5000 +RUN npm config set fetch-retry-mintimeout 3000 +RUN npm set registry http://localhost:5000 +# npm registry for dev purposes + +RUN mkdir -p /automatisch/storage +RUN touch /automatisch/storage/.env +RUN echo "ENCRYPTION_KEY=$(openssl rand -base64 36)" >> /automatisch/storage/.env +RUN echo "APP_SECRET_KEY=$(openssl rand -base64 36)" >> /automatisch/storage/.env +RUN yarn global add @automatisch/cli + +EXPOSE 3000 +CMD ["automatisch", "start", "--env-file=/automatisch/storage/.env"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..a0beceab --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,32 @@ +version: "3.9" +services: + automatisch: + build: + context: . + network: host + ports: + - "3000:3000" + depends_on: + - postgres + - redis + environment: + - HOST=localhost + - PROTOCOL=http + - PORT=3000 + - APP_ENV=production + - REDIS_HOST=redis + - POSTGRES_HOST=postgres + - POSTGRES_DATABASE=automatisch + - POSTGRES_USERNAME=automatisch_user + postgres: + image: "postgres:14.5" + ports: + - "5432:5432" + environment: + POSTGRES_HOST_AUTH_METHOD: trust + POSTGRES_DB: automatisch + POSTGRES_USER: automatisch_user + redis: + image: "redis:7.0.4" + ports: + - "6379:6379"