fix dockerfile for vite

main
Cogent Apps 2023-07-09 20:45:52 +00:00
parent 4f5e7fbdc8
commit a13fff35da
1 changed files with 4 additions and 9 deletions

View File

@ -14,9 +14,12 @@ COPY ./app/tsconfig.json ./
# Install Node.js dependencies # Install Node.js dependencies
RUN npm install RUN npm install
COPY ./app/vite.config.js ./
# Copy public, and src directories # Copy public, and src directories
COPY ./app/public ./public COPY ./app/public ./public
COPY ./app/src ./src COPY ./app/src ./src
COPY ./app/index.html ./
# Set environment variables # Set environment variables
ENV NODE_ENV=production ENV NODE_ENV=production
@ -29,14 +32,6 @@ FROM node:19-bullseye-slim AS server
# Set the working directory # Set the working directory
WORKDIR /app WORKDIR /app
# Update the package index and install required dependencies
# RUN apt-get update && \
# apt-get install -y \
# curl \
# build-essential \
# libssl-dev \
# openssl
COPY ./server/package.json ./server/tsconfig.json ./ COPY ./server/package.json ./server/tsconfig.json ./
# Install Node.js dependencies from package.json # Install Node.js dependencies from package.json
@ -45,7 +40,7 @@ RUN npm install
# Copy the rest of the application code into the working directory # Copy the rest of the application code into the working directory
COPY ./server/src ./src COPY ./server/src ./src
RUN CI=true sh -c "cd /app && mkdir data && npm run start && rm -rf data" RUN CI=true sh -c "cd /app && npm run start && rm -rf data"
COPY --from=build /app/build /app/public COPY --from=build /app/build /app/public