Skip to content

Commit 4885ab1

Browse files
committed
initial work on Dockerizing forum app
1 parent 145b513 commit 4885ab1

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

Dockerfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# We need
2+
3+
# 1) node 6.x.x
4+
# 2) postgres
5+
# 3)
6+
7+
FROM node:6
8+
RUN mkdir /code
9+
ADD . /code
10+
RUN mkdir /code/build
11+
ADD . /code/builddock
12+
WORKDIR /code
13+
RUN npm install
14+
EXPOSE 80
15+
CMD ["npm", "test"]
16+

docker-compose.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
version: "2"
2+
services:
3+
web:
4+
build: .
5+
ports:
6+
- 80:3000
7+
command: bash -c 'while !</dev/tcp/db/5432; do sleep 1; done; npm start'
8+
depends_on:
9+
- db
10+
environment:
11+
- DATABASE_URL=postgres://postgres:password@db:5432/forum
12+
- PORT=3000
13+
- FORUM_STORAGE_ADAPTER=S3
14+
db:
15+
image: postgres
16+
environment:
17+
- POSTGRES_USER=forum
18+
- POSTGRES_PASSWORD=password
19+
- POSTGRES_DB=forum

0 commit comments

Comments
 (0)