Skip to content

Commit 7fd3593

Browse files
committed
refactor: Dockerfile
1 parent eebabc7 commit 7fd3593

11 files changed

+790
-46
lines changed

Dockerfile

Lines changed: 0 additions & 41 deletions
This file was deleted.

Dockerfile.airflow

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
FROM apache/airflow:2.10.4
2+
3+
# Switch to root to install system dependencies
4+
USER root
5+
6+
# Install system dependencies with GPG signature verification workaround
7+
USER root
8+
RUN apt-get update -o Acquire::AllowInsecureRepositories=true \
9+
&& apt-get install -y --no-install-recommends --allow-unauthenticated \
10+
curl \
11+
unzip \
12+
gnupg \
13+
&& apt-get clean \
14+
&& rm -rf /var/lib/apt/lists/*
15+
16+
# Install Terraform 1.5.7
17+
RUN curl -fsSL https://releases.hashicorp.com/terraform/1.5.7/terraform_1.5.7_linux_amd64.zip -o terraform.zip && \
18+
unzip terraform.zip -d /usr/local/bin && \
19+
rm terraform.zip && \
20+
terraform --version # Verify installation
21+
22+
# Switch back to the airflow user
23+
USER airflow
24+
WORKDIR /opt/airflow
25+
26+
# Copy and install Python dependencies
27+
COPY requirements.txt ./
28+
RUN pip install --no-cache-dir -r requirements.txt
29+
30+
# Copy the rest of your application code
31+
COPY . .
32+
33+
# Expose the port for the Airflow webserver
34+
EXPOSE 8081
35+
36+
# Set the default command to start the webserver
37+
CMD ["airflow", "webserver", "--port", "8081"]

Dockerfile.dummy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
FROM alpine

Dockerfile.socket-server

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM node:20-slim
2+
3+
WORKDIR /app
4+
5+
COPY package*.json ./
6+
7+
RUN npm install
8+
9+
COPY ./server/server.js ./
10+
11+
EXPOSE 4000
12+
13+
CMD ["node", "server.js"]

Dockerfile.website

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM node:20
2+
3+
WORKDIR /app
4+
5+
COPY package.json package-lock.json ./
6+
7+
RUN npm install
8+
9+
COPY . .
10+
11+
RUN npm run build
12+
13+
EXPOSE 3000
14+
15+
CMD ["npm", "run", "start"]

debug.log

Lines changed: 636 additions & 0 deletions
Large diffs are not rendered by default.

docker-compose-minimal.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
version: "3"
2+
services:
3+
website:
4+
image: orchestronic.azurecr.io/orchestronic-app:website-latest
5+
ports:
6+
- "8080:3000"
7+
environment:
8+
- NODE_ENV=production
9+
command: ["npm", "run", "start"]
10+
socket-server:
11+
image: orchestronic.azurecr.io/orchestronic-app:socket-server-latest
12+
ports:
13+
- "4000:4000"
14+
environment:
15+
- NODE_ENV=production
16+
command: ["node", "server.js"]
17+
postgres:
18+
image: postgres:13
19+
environment:
20+
POSTGRES_USER: airflow
21+
POSTGRES_PASSWORD: airflow
22+
POSTGRES_DB: airflow
23+
redis:
24+
image: redis:7.2-bookworm
25+
expose:
26+
- 6379
27+
airflow-webserver:
28+
image: orchestronic.azurecr.io/orchestronic-app:airflow-webserver-latest
29+
command: webserver -p 8081
30+
ports:
31+
- "8081:8081"
32+
environment:
33+
AIRFLOW__CORE__EXECUTOR: CeleryExecutor
34+
AIRFLOW__DATABASE__SQL_ALCHEMY_CONN: postgresql+psycopg2://airflow:airflow@postgres/airflow
35+
AIRFLOW__CELERY__RESULT_BACKEND: db+postgresql://airflow:airflow@postgres/airflow
36+
AIRFLOW__CELERY__BROKER_URL: redis://:@redis:6379/0
37+
AIRFLOW__WEBSERVER__WEB_SERVER_PORT: "8081"

docker-compose.yaml

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,12 @@ x-airflow-common: &airflow-common
4949
# Comment the image line, place your Dockerfile in the directory where you placed the docker-compose.yaml
5050
# and uncomment the "build" line below, Then run `docker-compose build` to build the images.
5151
# image: ${AIRFLOW_IMAGE_NAME:-apache/airflow:2.10.4}
52-
build: .
52+
build:
53+
context: .
54+
dockerfile: Dockerfile.airflow
55+
image: ${AIRFLOW_IMAGE:-orchestronic.azurecr.io/orchestronic-app:airflow-webserver-latest}
5356
environment: &airflow-common-env
57+
PYTHONWARNINGS: "ignore"
5458
AIRFLOW__CORE__EXECUTOR: CeleryExecutor
5559
AIRFLOW__DATABASE__SQL_ALCHEMY_CONN: postgresql+psycopg2://airflow:airflow@postgres/airflow
5660
AIRFLOW__CELERY__RESULT_BACKEND: db+postgresql://airflow:airflow@postgres/airflow
@@ -83,6 +87,33 @@ x-airflow-common: &airflow-common
8387
condition: service_healthy
8488

8589
services:
90+
website:
91+
build:
92+
context: .
93+
dockerfile: Dockerfile.website
94+
image: ${WEBSITE_IMAGE:-orchestronic.azurecr.io/orchestronic-app:website-latest}
95+
ports:
96+
- "8080:3000"
97+
environment:
98+
- NODE_ENV=production
99+
command: ["npm", "run", start]
100+
depends_on:
101+
- socket-server
102+
restart: always
103+
104+
socket-server:
105+
build:
106+
context: .
107+
dockerfile: Dockerfile.socket-server
108+
image: ${WEBSITE_IMAGE:-orchestronic.azurecr.io/orchestronic-app:socket-server-latest}
109+
ports:
110+
- "4000:4000"
111+
environment:
112+
- NODE_ENV=production
113+
working_dir: /server
114+
command: ["node", "server.js"]
115+
restart: always
116+
86117
rabbitmq:
87118
image: rabbitmq:management-alpine
88119
tty: true
@@ -128,9 +159,12 @@ services:
128159
<<: *airflow-common
129160
command: webserver
130161
ports:
131-
- "8080:8080"
162+
- "8081:8081"
163+
environment:
164+
<<: *airflow-common-env
165+
AIRFLOW__WEBSERVER__WEB_SERVER_PORT: "8081"
132166
healthcheck:
133-
test: ["CMD", "curl", "--fail", "http://localhost:8080/health"]
167+
test: ["CMD", "curl", "--fail", "http://localhost:8081/health"]
134168
interval: 30s
135169
timeout: 10s
136170
retries: 5
@@ -260,7 +294,7 @@ services:
260294
_PIP_ADDITIONAL_REQUIREMENTS: ""
261295
user: "0:0"
262296
volumes:
263-
- ${AIRFLOW_PROJ_DIR:-.}:/sources
297+
- ${AIRFLOW_PROJ_DIR:-.}:/opt/airflow
264298

265299
airflow-cli:
266300
<<: *airflow-common

models/notification.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const notificationSchema = new Schema({
44
projectName: { type: String },
55
detail: { type: String },
66
userId: { type: String },
7-
date: { type: Date },
7+
date: { type: Date, default: Date.now },
88
});
99

1010
const Notification =

scaling.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
properties:
2+
configuration:
3+
minReplicas: 1
4+
maxReplicas: 10
5+
template:
6+
scale:
7+
rules:
8+
- name: cpu-scale
9+
custom:
10+
type: cpu
11+
metadata:
12+
value: "80" # CPU usage percentage (80%)
File renamed without changes.

0 commit comments

Comments
 (0)