FROM node:lts-alpine ARG api=http://192.168.1.51:8000 # "https://app.bookfarm.spacesheep.ovh" ENV VITE_BOOK_API_URL=$api # install simple http server for serving static content RUN npm install -g http-server # make the 'app' folder the current working directory WORKDIR /app # copy both 'package.json' and 'package-lock.json' (if available) COPY package*.json ./ # install project dependencies RUN npm install # copy project files and folders to the current working directory (i.e. 'app' folder) COPY . . # build app for production with minification RUN npm run build EXPOSE 8080 CMD [ "http-server", "dist" ] #sudo docker build -t book-farm/frontend . #sudo docker run -it -p 8080:8080 --rm --name book-farm-frontend book-farm/frontend