Merge pull request #491 from automatisch/issue-489
feat(docker-compose): add worker as service
This commit is contained in:
@@ -2,7 +2,7 @@ version: "3.9"
|
||||
services:
|
||||
automatisch:
|
||||
build:
|
||||
context: .
|
||||
context: ../images/wait-for-postgres
|
||||
network: host
|
||||
ports:
|
||||
- "3000:3000"
|
||||
@@ -18,6 +18,23 @@ services:
|
||||
- POSTGRES_HOST=postgres
|
||||
- POSTGRES_DATABASE=automatisch
|
||||
- POSTGRES_USERNAME=automatisch_user
|
||||
volumes:
|
||||
- automatisch_storage:/automatisch/storage
|
||||
worker:
|
||||
build:
|
||||
context: ../images/plain
|
||||
network: host
|
||||
depends_on:
|
||||
- automatisch
|
||||
environment:
|
||||
- APP_ENV=production
|
||||
- REDIS_HOST=redis
|
||||
- POSTGRES_HOST=postgres
|
||||
- POSTGRES_DATABASE=automatisch
|
||||
- POSTGRES_USERNAME=automatisch_user
|
||||
command: automatisch start-worker --env-file /automatisch/storage/.env
|
||||
volumes:
|
||||
- automatisch_storage:/automatisch/storage
|
||||
postgres:
|
||||
image: "postgres:14.5"
|
||||
environment:
|
||||
@@ -26,3 +43,5 @@ services:
|
||||
POSTGRES_USER: automatisch_user
|
||||
redis:
|
||||
image: "redis:7.0.4"
|
||||
volumes:
|
||||
automatisch_storage:
|
11
docker/images/plain/Dockerfile
Normal file
11
docker/images/plain/Dockerfile
Normal file
@@ -0,0 +1,11 @@
|
||||
# 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 yarn global add @automatisch/cli
|
@@ -3,7 +3,7 @@ FROM node:16
|
||||
WORKDIR /automatisch
|
||||
|
||||
RUN apt-get update && apt-get install -y postgresql-client
|
||||
COPY ./docker/wait-for-postgres.sh /automatisch/wait-for-postgres.sh
|
||||
COPY ./wait-for-postgres.sh /automatisch/wait-for-postgres.sh
|
||||
|
||||
# npm registry for dev purposes
|
||||
RUN npm config set fetch-retry-maxtimeout 5000
|
@@ -81,6 +81,8 @@
|
||||
"src",
|
||||
"server.js",
|
||||
"server.d.ts",
|
||||
"worker.js",
|
||||
"worker.d.ts",
|
||||
"logger.js",
|
||||
"logger.d.ts",
|
||||
"database.js",
|
||||
|
@@ -4,7 +4,6 @@ import Base from './base';
|
||||
import Step from './step';
|
||||
import Execution from './execution';
|
||||
import Telemetry from '../helpers/telemetry';
|
||||
import { IExecution } from '@automatisch/types';
|
||||
|
||||
class Flow extends Base {
|
||||
id!: string;
|
||||
|
Reference in New Issue
Block a user