-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.environment
38 lines (27 loc) · 1.06 KB
/
Dockerfile.environment
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Use the official Python image as the base image
FROM python:3.10.7
# Install Node.js and NPM
# RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
# RUN apt-get install -y nodejs
ARG NODE_VERSION=18.18.0
ARG NODE_PACKAGE=node-v$NODE_VERSION-linux-x64
ARG NODE_HOME=/opt/$NODE_PACKAGE
ENV NODE_PATH $NODE_HOME/lib/node_modules
ENV PATH $NODE_HOME/bin:$PATH
RUN curl https://nodejs.org/dist/v$NODE_VERSION/$NODE_PACKAGE.tar.gz | tar -xzC /opt/
RUN npm install -g npm@9.8.1
# Set the working directory to /app
WORKDIR /app
# 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 files to the container
COPY . .
# Create the .env file
RUN echo "PORT=3000\nWS_PORT=3001\nMONGO_URI=mongodb+srv://nathantranchant:YHjtNrFvBBS51fh4@mqdev.odpjjqk.mongodb.net/masterquizz\nCORS_WHITELIST=http://localhost:3000,http://localhost:8080\nENCRYPTION_KEY=masterquizz06" > backend/.env
EXPOSE 8080
EXPOSE 3000
EXPOSE 3001
# Start the application
CMD ["npm", "run", "prod"]