Skip to content

Commit

Permalink
Dockerize the app for local development
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwr18 committed Feb 22, 2019
1 parent ec89a67 commit 7780477
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 7 deletions.
9 changes: 9 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Dockerfile
.dockerignore
.gitignore
README.md

# Artifacts that will be built during image creation.
# This should contain all files created during `npm run build`.
build
node_modules
9 changes: 3 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
FROM node:10.15-alpine

RUN mkdir /websitone-fe
WORKDIR /websitone-fe
RUN mkdir /websiteone-fe
WORKDIR /websiteone-fe
COPY . .
RUN npm rebuild node-sass
RUN yarn

EXPOSE 8080

CMD ["yarn", "start"]
ENTRYPOINT [ "./entrypoint.sh" ]
8 changes: 8 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: '3'
services:
web:
build: .
ports:
- '8080:8080'
volumes:
- .:/websiteone-fe/:rw
4 changes: 4 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

npm rebuild node-sass
yarn start-for-docker
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"author": "AgileVentures",
"license": "MIT",
"scripts": {
"start": "webpack-dev-server --mode development --open",
"start": "webpack-dev-server --mode development",
"start-for-docker": "webpack-dev-server --mode development --host 0.0.0.0",
"build": "webpack --mode production",
"fix": "standard --fix",
"test": "export NODE_ENV=testing && standard && jest",
Expand Down

0 comments on commit 7780477

Please sign in to comment.