Skip to content

Commit

Permalink
ci: Add docker-compose
Browse files Browse the repository at this point in the history
  • Loading branch information
hamzahamidi committed Dec 6, 2020
1 parent 79d7a00 commit 00115d7
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ COPY . ./
RUN npm run build

FROM nginx
COPY docker/nginx/default.conf /etc/nginx/conf.d/default.conf
COPY --from=compile-image /opt/ng/dist/app-name /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=compile-image /app/dist /usr/share/nginx/html
34 changes: 26 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,46 @@ Webpack typescript starter with:
- Ts-jest
- Eslint

### [Demo](https://webpack-typescript-starter.netlify.app/)
## [Demo](https://webpack-typescript-starter.netlify.app/)

# Getting started
## Getting started

Make sure to have NodeJs already installed:
Make sure to have NodeJs already installed.

## Install all dependencies.
### Install all dependencies

```bash
npm install
```

## Start developing and serve your app:
### Start developing and serve your app

```bash
npm start
```

## Build your application:
### Build your application

```bash
npm run build
```

## Run unit tests:
### Run unit tests

```bash
npm run test
```

## Run coverage:
### Run coverage

```bash
npm run coverage
```

### Docker

Or simply run the example using docker:

```bash
docker-compose up
```
11 changes: 11 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: '3.5'
services:
front-application:
container_name: webpack-starter-container
build:
context: .
dockerfile: Dockerfile
volumes:
- '.:/usr/src/app'
ports:
- '4000:8080'
17 changes: 17 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
server {

listen 8080;

server_name localhost;

root /usr/share/nginx/html;

index index.html index.htm;

location / {

try_files $uri $uri/ /index.html;

}

}

0 comments on commit 00115d7

Please sign in to comment.