Skip to content

Commit 97d9cc4

Browse files
committed
Update dockerfile
1 parent 6a2be60 commit 97d9cc4

3 files changed

Lines changed: 17 additions & 11 deletions

File tree

config/config.development.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"databaseConfig": {
3-
"host": "localhost",
3+
"host": "mongodb",
44
"database": "funWithDocker"
55
}
66
}

config/config.production.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"databaseConfig": {
3+
"host": "mongodb",
4+
"database": "funWithDocker"
5+
}
6+
}

node.dockerfile

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,18 @@
1515
# docker run -d --name my-mongodb mongo
1616
# docker run -d -p 3000:3000 --link my-mongodb:mongodb --name nodeapp danwahlin/node
1717

18-
FROM node:alpine
18+
FROM node:alpine
1919

20-
LABEL author="Dan Wahlin"
20+
LABEL author="Dan Wahlin"
2121

22-
ENV NODE_ENV=development
23-
ENV PORT=3000
22+
ENV NODE_ENV=production
23+
ENV PORT=3000
2424

25-
COPY . /var/www
26-
WORKDIR /var/www
25+
WORKDIR /var/www
26+
COPY package.json package-lock.json ./
27+
RUN npm install
2728

28-
RUN npm install
29+
COPY . ./
30+
EXPOSE $PORT
2931

30-
EXPOSE $PORT
31-
32-
ENTRYPOINT ["npm", "start"]
32+
ENTRYPOINT ["npm", "start"]

0 commit comments

Comments
 (0)