diff --git a/authy/.dockerignore b/authy/.dockerignore new file mode 100644 index 0000000..2f7896d --- /dev/null +++ b/authy/.dockerignore @@ -0,0 +1 @@ +target/ diff --git a/docker-compose.yml b/docker-compose.yml index 6b44671..427b5ef 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,16 +1,17 @@ services: postgres: image: postgres:latest - ports: + ports: - "5434:5432" volumes: - db_data:/var/lib/postgresql/data + - ./postgres-init.sql:/docker-entrypoint-initdb.d/init.sql environment: - POSTGRES_PASSWORD=admin - POSTGRES_USER=admin mongodb: image: mongodb/mongodb-community-server:latest - ports: + ports: - "27017:27017" environment: - MONGO_INITDB_ROOT_USERNAME=admin @@ -22,7 +23,7 @@ services: - "1025:1025" usernator: build: ./usernator - ports: + ports: - "3001:3000" - "3004:3001" environment: @@ -40,12 +41,20 @@ services: depends_on: - postgres - maildev + restart: on-failure:3 + deploy: + restart_policy: + condition: on-failure + delay: 5s + max_attempts: 3 + window: 120s + authy: build: context: ./authy args: - ARCH=aarch64 - ports: + ports: - "3002:3000" environment: - JWT_SECRET=secret @@ -54,18 +63,26 @@ services: depends_on: - usernator - tasky + restart: on-failure:3 + deploy: + restart_policy: + condition: on-failure + delay: 5s + max_attempts: 3 + window: 120s + tasky: build: context: ./tasky args: - ARCH=aarch64 - ports: + ports: - "3005:3000" - "3006:3001" environment: - DB_NAME=tasky - - DB_USERNAME=tasky - - DB_PASSWORD=tasky + - DB_USERNAME=usernator + - DB_PASSWORD=usernator - DB_HOST=postgres:5432 - USERNATOR_GRPC=http://usernator:3001 - MONGO_HOST="mongodb:27017" @@ -76,6 +93,14 @@ services: depends_on: - usernator - postgres + restart: on-failure:3 + deploy: + restart_policy: + condition: on-failure + delay: 5s + max_attempts: 3 + window: 120s + executor: build: ./executor ports: @@ -102,5 +127,23 @@ services: - BACKEND_URL=http://executor:8000 depends_on: - executor + + + web: + build: + context: web/ + dockerfile: Dockerfile + ports: + - "3000:3000" + environment: + - API_URL=http://localhost:3002 + - EXECUTOR_UI_URL=http://localhost:3007 + depends_on: + - authy + - executor_ui + - tasky + - usernator + + volumes: - db_data: \ No newline at end of file + db_data: diff --git a/postgres-init.sql b/postgres-init.sql new file mode 100644 index 0000000..f66702a --- /dev/null +++ b/postgres-init.sql @@ -0,0 +1,16 @@ +CREATE USER usernator WITH PASSWORD 'usernator'; +CREATE DATABASE usernator; +GRANT ALL PRIVILEGES ON DATABASE usernator TO usernator; + +CREATE USER tasky WITH PASSWORD 'tasky'; +CREATE DATABASE tasky; +GRANT ALL PRIVILEGES ON DATABASE tasky TO tasky; + +CREATE USER executor WITH PASSWORD 'executor'; +CREATE DATABASE executor; +GRANT ALL PRIVILEGES ON DATABASE executor TO executor; + + +ALTER USER usernator WITH SUPERUSER; +ALTER USER tasky WITH SUPERUSER; +ALTER USER executor WITH SUPERUSER; diff --git a/tasky/.dockerignore b/tasky/.dockerignore index 2eea525..b7f7b51 100644 --- a/tasky/.dockerignore +++ b/tasky/.dockerignore @@ -1 +1,2 @@ -.env \ No newline at end of file +.env +target/ diff --git a/tasky/Dockerfile b/tasky/Dockerfile index f5811a2..69cf4ea 100644 --- a/tasky/Dockerfile +++ b/tasky/Dockerfile @@ -14,7 +14,7 @@ RUN rm ./target/release/deps/tasky* ENV IS_DOCKER="true" RUN cargo build --release -FROM busybox:1.35.0-uclibc as busybox +FROM busybox:1.35.0-uclibc AS busybox FROM gcr.io/distroless/cc-debian12 ARG ARCH=x86_64 diff --git a/web/.dockerignore b/web/.dockerignore new file mode 100644 index 0000000..57ff971 --- /dev/null +++ b/web/.dockerignore @@ -0,0 +1,2 @@ +node_modules/ +.next/ diff --git a/web/components/solution/ExecutorUIDisplay.tsx b/web/components/solution/ExecutorUIDisplay.tsx index 81e4d89..cf151a3 100644 --- a/web/components/solution/ExecutorUIDisplay.tsx +++ b/web/components/solution/ExecutorUIDisplay.tsx @@ -1,4 +1,5 @@ import { Modal } from "@mantine/core"; +import getConfig from "next/config"; export interface ExecutorUIDisplayProps { jobId: string; @@ -6,8 +7,10 @@ export interface ExecutorUIDisplayProps { } const ExecutorUIDisplay = ({ jobId, onClose }: ExecutorUIDisplayProps) => { - const apiUrl = process.env.NODE_ENV === "production" ? "https://executor.code-canvas.app" : "http://localhost:3007"; - + const apiUrl = + getConfig().publicRuntimeConfig.EXECUTOR_UI_URL === "" + ? "http://localhost:3008" + : getConfig().publicRuntimeConfig.EXECUTOR_UI_URL; return (