Skip to content

Commit

Permalink
Merge pull request #5 from lowsideio/beta
Browse files Browse the repository at this point in the history
next release - Dockerize
  • Loading branch information
AkselsLedins authored Oct 29, 2017
2 parents 6a278f5 + 222e4bc commit 8b4fee0
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
npm-debug.log
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Dockerfile

FROM node:8-alpine

WORKDIR /usr/src/app

COPY package.json .

RUN npm install

# Bundle app source
COPY . .

RUN npm run build

EXPOSE 3000

CMD [ "npm", "run", "prod" ]
6 changes: 6 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: '3'
services:
web:
build: .
ports:
- "10001:3000"
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
"author": "Aksels Ledins <[email protected]>",
"private": true,
"scripts": {
"prod": "node production-server.js",
"in-docker": "docker-compose up",
"dev": "node build/dev-server.js",
"start": "npm run dev",
"build": "node build/build.js",
Expand Down Expand Up @@ -44,7 +46,7 @@
"eslint-plugin-html": "^3.0.0",
"eslint-plugin-import": "^2.7.0",
"eventsource-polyfill": "^0.9.6",
"express": "^4.14.1",
"express": "^4.16.2",
"extract-text-webpack-plugin": "^3.0.0",
"file-loader": "^1.1.4",
"friendly-errors-webpack-plugin": "^1.6.1",
Expand Down
18 changes: 18 additions & 0 deletions production-server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

const express = require('express');

const app = express();
const router = express.Router();

app.use(express.static(`${__dirname}/dist`));

app.get('/*', (req, res) => {
res.sendFile(`${__dirname}/dist/index.html`);
});

app.use('/', router);

app.listen(3000, () => {
// eslint-disable-next-line
console.log('lowside.io - web-frontend - running');
});
1 change: 0 additions & 1 deletion src/components/SearchBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export default {
try {
const response = await axios.get(`http://localhost:1323/search/${this.inputValue}`);
this.results = response.data;
console.log('this.results', this.results);
} catch (e) {
this.errors.push(e);
}
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2362,7 +2362,7 @@ expand-range@^1.8.1:
dependencies:
fill-range "^2.1.0"

express@^4.14.1, express@^4.15.2:
express@^4.15.2, express@^4.16.2:
version "4.16.2"
resolved "https://registry.yarnpkg.com/express/-/express-4.16.2.tgz#e35c6dfe2d64b7dca0a5cd4f21781be3299e076c"
dependencies:
Expand Down

0 comments on commit 8b4fee0

Please sign in to comment.