Skip to content

Commit

Permalink
Improved dev initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
KalpitaMandal committed Jan 22, 2025
1 parent b31340f commit a5b4252
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 14 deletions.
20 changes: 20 additions & 0 deletions Dockerfile.bun
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Use the official Node.js image as the base image
FROM node:18.17.0

# Set the working directory in the container
WORKDIR /app/terminal

# Copy the package.json and package-lock.json files to the container
COPY package*.json ./

# Install the dependencies
RUN npm install

# Copy the rest of the application code into the container
COPY ./terminal .

# Expose the port the app runs on
EXPOSE 6060

# Command to run the app
CMD [ "node", "./src/server.js"]
25 changes: 13 additions & 12 deletions Dockerfile → Dockerfile.chr
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,24 @@ ENV PATH="/root/.bun/bin:$PATH"
COPY . .

RUN ["bun", "install"]
CMD [ "chr", "node", "start" ]

RUN apt-get install -y build-essential wget
# RUN apt-get install -y build-essential wget

# Install Node dependencies.
RUN wget https://nodejs.org/dist/v18.17.0/node-v18.17.0-linux-x64.tar.xz \
&& mkdir -p /node && tar -xf node-v18.17.0-linux-x64.tar.xz -C /node \
&& chmod +x -R /node/node-v18.17.0-linux-x64
# # Install Node dependencies.
# RUN wget https://nodejs.org/dist/v18.17.0/node-v18.17.0-linux-x64.tar.xz \
# && mkdir -p /node && tar -xf node-v18.17.0-linux-x64.tar.xz -C /node \
# && chmod +x -R /node/node-v18.17.0-linux-x64

# Setup Path
ENV PATH="/node/node-v18.17.0-linux-x64/bin:${PATH}"
# # Setup Path
# ENV PATH="/node/node-v18.17.0-linux-x64/bin:${PATH}"

WORKDIR /app/terminal
# WORKDIR /app/terminal

RUN npm install
# RUN npm install

EXPOSE 6060
# EXPOSE 6060

WORKDIR /app
# WORKDIR /app

ENTRYPOINT [ "node", "./terminal/src/server.js" ]
# ENTRYPOINT [ "node", "./terminal/src/server.js" ]
18 changes: 17 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,27 @@ services:

# Chromia node service
chr-node:
image: kalpita888/chromia-node:1.0.0
# image: kalpita888/chr-node:1.0.0
build:
context: .
dockerfile: Dockerfile.chr
container_name: my-chr-node
init: true
network_mode: host
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy

# Bun service
bun:
# image: kalpita888/bun:1.0.0
build:
context: .
dockerfile: Dockerfile.bun
container_name: my-chat-agent
init: true
network_mode: host
restart: unless-stopped
depends_on:
- chr-node
3 changes: 2 additions & 1 deletion terminal/src/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ function init() {
term._initialized = true;

term.prompt = () => {
// runCommand('docker exec -it chromia-neural-interface_chr-node_1 sh -c "bun run dev"');
runCommand('\n');
runCommand('clear');
runCommand('\n');
runCommand('bun run dev');
runCommand('\n');
};
setTimeout(() => {
term.prompt();
Expand Down

0 comments on commit a5b4252

Please sign in to comment.