chore: add docker-compose support
This commit is contained in:
18
Dockerfile
Normal file
18
Dockerfile
Normal file
@@ -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"]
|
32
docker-compose.yml
Normal file
32
docker-compose.yml
Normal file
@@ -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"
|
Reference in New Issue
Block a user