Skip to content

Commit 10107b8

Browse files
authored
Merge pull request vasanthv#5 from JustDevNull/docker-compose
Added Dockerfile and docker-compose files
2 parents 92b5d1b + 60e9021 commit 10107b8

File tree

4 files changed

+81
-0
lines changed

4 files changed

+81
-0
lines changed

.dockerignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# git folder
2+
.git
3+
4+
# NPM
5+
node_modules
6+
npm-debug.log
7+
8+
# Testing
9+
.nyc_output
10+
11+
# Mac
12+
.DS_Store
13+
14+
# cache
15+
.cache

Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM node:14.9.0-alpine3.10
2+
3+
WORKDIR /app
4+
5+
COPY package*.json ./
6+
7+
RUN npm install
8+
9+
COPY . .
10+
11+
EXPOSE 3000
12+
CMD [ "node", "server.js" ]

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ Open the following url in the browser
3434
http://localhost:3000
3535
```
3636

37+
### Docker compose
38+
39+
[NGINX proxy](https://hub.docker.com/r/jwilder/nginx-proxy) container with [its companion](https://github.com/nginx-proxy/docker-letsencrypt-nginx-proxy-companion) to proxy the access to the app and generate a SSL certificate with [Let's Encrypt](https://letsencrypt.org/).
40+
41+
**Note:** its recommended to launch without the companion in local environments.
42+
3743
### LICENSE
3844

3945
<a href="https://github.com/vasanthv/talk/blob/master/LICENSE">MIT License</a>

docker-compose.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
version: '3.7'
2+
3+
services:
4+
## Container that proxies all trafic to the containers configured
5+
## with VIRTUAL_HOST
6+
nginx-proxy:
7+
image: jwilder/nginx-proxy
8+
container_name: nginx-proxy
9+
ports:
10+
- 80:80
11+
- 443:443
12+
volumes:
13+
- conf:/etc/nginx/conf.d
14+
- vhost:/etc/nginx/vhost.d
15+
- html:/usr/share/nginx/html
16+
- dhparam:/etc/nginx/dhparam
17+
- certs:/etc/nginx/certs:ro
18+
- /var/run/docker.sock:/tmp/docker.sock:ro
19+
## Container that generates SSL certificates with Let's Encrypt
20+
## for all containers with the LETSENCRYPT_HOST LETSENCRYPT_EMAIL
21+
## enviroment settings
22+
letsencrypt:
23+
image: jrcs/letsencrypt-nginx-proxy-companion
24+
container_name: nginx-proxy-le
25+
volumes:
26+
- conf:/etc/nginx/conf.d
27+
- vhost:/etc/nginx/vhost.d
28+
- html:/usr/share/nginx/html
29+
- dhparam:/etc/nginx/dhparam
30+
- certs:/etc/nginx/certs:rw
31+
- /var/run/docker.sock:/var/run/docker.sock:ro
32+
## App container exposing the port 3000 for the proxy
33+
talk:
34+
image: talk:latest
35+
build:
36+
context: .
37+
expose:
38+
- 3000
39+
environment:
40+
- VIRTUAL_HOST=talk.vasanthv.com
41+
- LETSENCRYPT_HOST=talk.vasanthv.com
42+
43+
volumes:
44+
conf:
45+
vhost:
46+
html:
47+
dhparam:
48+
certs:

0 commit comments

Comments
 (0)