#syntax=docker/dockerfile:1.4 # Run this from within this directory. Change the location of coriolis-data repo and image name/tag as needed. # docker buildx build --build-context data=../coriolis-data --tag coriolis:0.0.7-local-prod -f Dockerfile-local-prod . # docker run -d -p 80:8080 coriolis:0.0.7-local-prod FROM node:18-alpine # TODO: For a production build, we may want to just build the bundle and copy that in. No need for local copy of source. WORKDIR /app ADD . . # COPY --from=data . /coriolis-data/ # Git is required before install if any modules (like coriolis-data is now referenced in the package.json) are loaded from github RUN apk update RUN apk add git # WORKDIR /app/coriolis-data # RUN npm install # WORKDIR /app # RUN npm install # Bundle for production config with webpack & log # In this version of the dockerfile, I'm deferring automated webpack build so I can monitor a manual build # RUN npm run build > >(tee -a stdout.log) 2> >(tee -a stderr.log >&2) RUN npm install -g http-server # Optimally, this will start a static asset server like nginx/apache. Currently, this will start dev webpack server. # CMD ["http-server", "/app/build", "-c-1"] CMD ["/bin/ash"] # CMD [""] EXPOSE 8080