From e685e08131908f45aeb692c87ce6794dd5823f10 Mon Sep 17 00:00:00 2001 From: Jordan Miller Date: Sat, 20 Jun 2020 14:00:08 -0400 Subject: [PATCH] Add docker support (#26) * Add docker support * Trigger actions --- Dockerfile | 15 +++++++++++++++ docker-compose.yml | 19 +++++++++++++++++++ docker-entry.sh | 6 ++++++ 3 files changed, 40 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml create mode 100644 docker-entry.sh 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 "$@"