Skip to content

Commit

Permalink
Fixes docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
swapkats committed Jul 5, 2020
1 parent b0bf419 commit 47ede6c
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/aws.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
# Build a docker container and
# push it to ECR so that it can
# be deployed to ECS.
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
make build -- -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
echo "::set-output name=image::$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG"
Expand Down
6 changes: 6 additions & 0 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Dockerfile (tag: v3)
FROM node:12.18.2
WORKDIR /usr/src/app
RUN npm config set registry http://registry.npmjs.org/ && npm install
CMD ["npm", "start"]
EXPOSE 8080
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dev:
@docker-compose -f docker-compose.dev.yml up --build

prod:
@docker-compose -f docker-compose.yml up --build
10 changes: 10 additions & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: '3'
services:
web:
build:
context: .
dockerfile: Dockerfile.dev
volumes:
- .:/usr/src/app/
ports:
- 8080:8080
55 changes: 28 additions & 27 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
var path = require('path');
var HtmlWebpackPlugin = require('html-webpack-plugin');
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');

module.exports = {
// Change to your "entry-point".
entry: './app/index',
output: {
path: path.resolve(__dirname, 'public'),
filename: 'app.bundle.js'
},
devServer: {
contentBase: './public',
},
resolve: {
extensions: ['.ts', '.tsx', '.js', '.json']
},
module: {
rules: [{
// Include ts, tsx, js, and jsx files.
test: /\.(ts|js)x?$/,
exclude: /node_modules/,
loader: 'babel-loader',
}],
},
plugins: [
new HtmlWebpackPlugin({
template: path.resolve(__dirname, 'public/index.html')
})
]
// Change to your "entry-point".
entry: './app/index',
output: {
path: path.resolve(__dirname, 'public'),
filename: 'app.bundle.js',
},
devServer: {
host: '0.0.0.0',
contentBase: './public',
},
resolve: {
extensions: ['.ts', '.tsx', '.js', '.json'],
},
module: {
rules: [{
// Include ts, tsx, js, and jsx files.
test: /\.(ts|js)x?$/,
exclude: /node_modules/,
loader: 'babel-loader',
}],
},
plugins: [
new HtmlWebpackPlugin({
template: path.resolve(__dirname, 'public/index.html'),
}),
],
};

0 comments on commit 47ede6c

Please sign in to comment.