From 684f4d900dda3037914531a718a30bed9044eeff Mon Sep 17 00:00:00 2001 From: Manfred Touron Date: Thu, 9 May 2019 10:29:09 +0200 Subject: [PATCH] feat: dockerize web --- .dockerignore | 3 +++ .gitignore | 2 ++ docker-compose.yml | 10 +++++++++- web/Dockerfile | 15 +++++++++++++++ 4 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 web/Dockerfile diff --git a/.dockerignore b/.dockerignore index 2af4c450d..c4b9d2692 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,6 @@ +node_modules +package-lock.json +yarn.lock .circleci/ test/ .git/ diff --git a/.gitignore b/.gitignore index 59f2c02c7..750f970db 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +.env + vendor/ *~ *# diff --git a/docker-compose.yml b/docker-compose.yml index ca4b1c246..a33f7df79 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -22,4 +22,12 @@ services: - 3306:3306 environment: MYSQL_ROOT_PASSWORD: uns3cur3 - MYSQL_DATABASE: pathwar \ No newline at end of file + MYSQL_DATABASE: pathwar + + web: + build: web + ports: + - 3000:3000 + - 3001:3001 + environment: + - NODE_ENV=development diff --git a/web/Dockerfile b/web/Dockerfile new file mode 100644 index 000000000..c77f64c21 --- /dev/null +++ b/web/Dockerfile @@ -0,0 +1,15 @@ +FROM node:11-stretch + +WORKDIR /app + +COPY package*.json ./ + +RUN npm install +#RUN npm ci --only=production + +COPY . . + +EXPOSE 3000 3001 +CMD [ "npm", "start" ] + +# FIXME: add build step for production