vijayksagi commited on
Commit
82dd094
·
verified ·
1 Parent(s): 81d307b

Upload Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -62
Dockerfile CHANGED
@@ -1,68 +1,16 @@
 
1
 
2
- FROM python:3.10
3
- FROM continuumio/miniconda3
4
-
5
- RUN useradd user
6
-
7
- USER user
8
-
9
-
10
- COPY ./requirements.txt requirements.txt
11
-
12
-
13
-
14
- ENV PYTHONDONTWRITEBYTECODE=1
15
- ENV PYTHONUNBUFFERED=1
16
-
17
-
18
- ENV DEBIAN_FRONTEND=noninteractive
19
- ENV PATH /opt/conda/bin:$PATH
20
-
21
- # Set working directory
22
  WORKDIR /app
23
 
24
- # Copy backend files
25
- COPY . /app
26
-
27
- USER root
28
-
29
-
30
- RUN apt-get update && apt-get install -y build-essential git curl
31
-
32
- # Create conda environment & install Python 3.10
33
- RUN conda create --name myenv python=3.10 -y
34
-
35
- SHELL ["conda", "run", "-n", "myenv", "/bin/bash", "-c"]
36
-
37
-
38
- RUN pip install --upgrade pip && pip install -r requirements.txt
39
-
40
- # Clone React frontend from GitHub
41
-
42
-
43
- RUN apt-get update && \
44
- apt-get install -y git curl && \
45
- git clone https://github.com/vijaysagi12/myinzackBot.git /frontend
46
-
47
- COPY . .
48
-
49
-
50
- # Install Node.js & npm (for React)
51
- RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \
52
- apt-get install -y nodejs && \
53
- cd /frontend && npm install -- --no-cache
54
-
55
-
56
- RUN rm -f /frontend/node_modules/.cache/.eslintcache || true
57
-
58
-
59
- # Expose Flask and React ports
60
- EXPOSE 5000 3000
61
-
62
- # Start both Flask and React servers
63
- CMD ["/bin/bash", "-c", "source activate myenv && \
64
- (cd /frontend && npm start &) && \
65
- python app.py"]
66
 
 
 
67
 
 
 
68
 
 
 
 
1
+ FROM node:18
2
 
3
+ # Set working directory inside container
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  WORKDIR /app
5
 
6
+ # Clone the repository
7
+ RUN git clone https://github.com/vijaysagi12/myinzackBot.git .
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
 
9
+ # Install dependencies
10
+ RUN npm install
11
 
12
+ # Expose the React app's default port
13
+ EXPOSE 3000
14
 
15
+ # Start the React server
16
+ CMD ["npm", "start"]