Skip to content

Commit 54061e9

Browse files
authored
Merge pull request #5 from danny-avila/main
Merge latest from source
2 parents e64d193 + e02e615 commit 54061e9

File tree

3 files changed

+42
-7
lines changed

3 files changed

+42
-7
lines changed

Dockerfile-app

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# ./Dockerfile
2+
3+
FROM node:19-alpine
4+
WORKDIR /app
5+
6+
# Copy package.json files for client and api
7+
COPY /client/package*.json /app/client/
8+
COPY /api/package*.json /app/api/
9+
10+
# Install dependencies for both client and api
11+
RUN cd /app/client && npm ci
12+
RUN cd /app/api && npm ci
13+
14+
# Copy the current directory contents into the container
15+
COPY /client/ /app/client/
16+
COPY /api/ /app/api/
17+
18+
# Set the memory limit for Node.js
19+
ENV NODE_OPTIONS="--max-old-space-size=2048"
20+
21+
# Build webpack artifacts for the client
22+
RUN cd /app/client && npm run build
23+
24+
# Create the necessary directory and copy the client side code to the api directory
25+
RUN mkdir -p /app/api/client && cp -R /app/client/dist /app/api/client/dist
26+
27+
# Make port 3080 available to the world outside this container
28+
EXPOSE 3080
29+
30+
# Expose the server to 0.0.0.0
31+
ENV HOST=0.0.0.0
32+
33+
# Run the app when the container launches
34+
WORKDIR /app/api
35+
CMD ["npm", "start"]

client/src/components/Messages/Message.jsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,8 @@ export default function Message({
150150
) : edit ? (
151151
<div className="flex min-h-[20px] flex-grow flex-col items-start gap-4 ">
152152
{/* <div className={`${blinker ? 'result-streaming' : ''} markdown prose dark:prose-invert light w-full break-words`}> */}
153-
154153
<div
155-
className="markdown prose dark:prose-invert light w-full break-words border-none focus:outline-none"
154+
className="markdown prose dark:prose-invert light w-full whitespace-pre-wrap break-words border-none focus:outline-none"
156155
contentEditable={true}
157156
ref={textEditor}
158157
suppressContentEditableWarning={true}

docker-compose.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@ services:
1515
# - api
1616
api:
1717
ports:
18-
- 3080:3080 # Change it to 9000:3080 if you want to use nginx
18+
- 3080:3080 # Change it to 9000:3080 to use nginx
1919
depends_on:
2020
- mongodb
21-
image: node-api
22-
build:
23-
context: .
24-
target: node-api
21+
# image: node-api # Uncomment this to build from local file
22+
# build:
23+
# context: .
24+
# target: node-api
25+
image: chatgptclone/app:0.3.3 # Comment this & uncomment above to build from local file
2526
restart: always
2627
env_file:
2728
- ./api/.env

0 commit comments

Comments
 (0)