Skip to content

Commit

Permalink
setting deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
mihalskiy committed Dec 9, 2018
1 parent 61ff07e commit 46866ec
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 25 deletions.
39 changes: 22 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,25 @@ COPY client/ ./
RUN npm run build


# Setup the server

FROM node:9.4.0-alpine

WORKDIR /usr/app/
COPY --from=client /usr/app/client/build/ ./client/build/

WORKDIR /usr/app/server/
COPY server/package*.json ./
RUN npm install -qy
COPY server/ ./

ENV PORT 8000

EXPOSE 8000

CMD ["npm", "start"]
## Setup the server
#
#FROM node:9.4.0-alpine
#
#WORKDIR /usr/app/
#COPY --from=client /usr/app/client/build/ ./client/build/
#
#WORKDIR /usr/app/server/
#COPY server/package*.json ./
#RUN npm install -qy
#COPY server/ ./
#
#ENV PORT 8000
#
#EXPOSE 8000
#
#CMD ["npm", "start"]

FROM nginx:1.13.12-alpine
COPY --from=client /usr/app/client/build /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
17 changes: 9 additions & 8 deletions client/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
FROM node:9.4.0
# Setup and build the client

WORKDIR /usr/app
FROM node:9.4.0-alpine as client

WORKDIR /usr/app/client/
COPY package*.json ./

RUN npm install -qy
COPY . .
RUN npm run build

COPY . .

EXPOSE 3000

CMD ["npm", "start"]
FROM nginx:1.13.12-alpine
COPY --from=client /usr/app/client/build /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
8 changes: 8 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,11 @@ services:
POSTGRES_PASSWORD: password
POSTGRES_USER: user
POSTGRES_DB: db

nginx:
image: nginx:1.13.12-alpine
ports:
- "80:80"
volumes:
- ./usr/share/nginx/html
- /usr/app/client/build: /usr/share/nginx/html

0 comments on commit 46866ec

Please sign in to comment.