ChatApp / Dockerfile
Anuj-Panthri's picture
added DB_NAME env var
61818f5
raw
history blame contribute delete
763 Bytes
FROM node:20-bullseye-slim AS client-builder
WORKDIR /client
ARG REACT_APP_BACKEND_URL=https://anuj-panthri-chatapp.hf.space
ENV REACT_APP_BACKEND_URL=${REACT_APP_BACKEND_URL}
# Copies flutter project
COPY ./client /client
# Building project
RUN npm install
RUN npm run build
# STAGE 2
# Install Node Server
FROM node:20-bullseye-slim
EXPOSE 3000
WORKDIR /server
# Copy server project
COPY ./server /server
COPY --from=client-builder /client/build /client/build
# permissions
RUN chmod 777 /server;
RUN touch /server/main.db;
RUN chmod 777 /server/main.db;
RUN ls -lh
ENV DB_NAME="main.db"
# Install node_modules and run project
RUN npm install
RUN npm run dbinit
RUN chmod 777 /server;
RUN chmod 777 /server/main.db;
RUN ls -lh
CMD npm run server