diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b28444b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +# base image +FROM node:14 + +# set working directory +WORKDIR /app + +EXPOSE 3000 + +# add `/app/node_modules/.bin` to $PATH +ENV PATH /app/node_modules/.bin:$PATH + +# install and cache app dependencies +COPY package.json /app/package.json + +ENTRYPOINT ["/app/docker-entry.sh"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..da96898 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,19 @@ +version: "3" + +volumes: + pwa_node_modules: + +services: + pwa: + build: + context: . + dockerfile: ./Dockerfile + tty: true + command: npm run dev + env_file: + - .env + ports: + - 3000:3000 + volumes: + - ./:/app:delegated + - pwa_node_modules:/app/node_modules diff --git a/docker-entry.sh b/docker-entry.sh new file mode 100644 index 0000000..3d329a1 --- /dev/null +++ b/docker-entry.sh @@ -0,0 +1,6 @@ +#!/bin/sh +set -e + +npm install + +exec "$@"