Skip to content

Instantly share code, notes, and snippets.

@zubair1024
Last active January 13, 2020 19:46
Show Gist options
  • Save zubair1024/be98634111babf634e81846bdd7a7c6a to your computer and use it in GitHub Desktop.
Save zubair1024/be98634111babf634e81846bdd7a7c6a to your computer and use it in GitHub Desktop.
**/node_modules
node_modules
FROM node:13
WORKDIR /usr/app
RUN mkdir -p ./titan-base ./titan-com
COPY ./titan-base/package.json ./titan-base
RUN cd ./titan-base && npm install
COPY ./titan-com/package.json ./titan-com
RUN cd ./titan-com && npm install
COPY ./titan-base ./titan-base
COPY ./titan-com ./titan-com
# CMD ["node","./titan-com/index.js"]
version: "3"
services:
redis:
image: redis
container_name: cache
restart: always
expose:
- 6379
comapp:
build:
context: .
dockerfile: titancom.Dockerfile
container_name: comapp
volumes:
- usr/app/titan-base/node_modules
- usr/app/titan-com/node_modules
- .:/usr/app/
# restart: always
links:
- redis
ports:
- "5101:5101"
- "5102:5102"
- "4100:4100"
environment:
- REDIS_URL=redis://cache
- container=true
command: ["node", "./titan-com/index.js"]
webapp:
build:
context: .
dockerfile: titanweb.Dockerfile
container_name: webapp
volumes:
- usr/app/titan-base/node_modules
- usr/app/titan-web/node_modules
- .:/usr/app/
# restart: always
links:
- redis
- comapp
ports:
- "8080:8080"
environment:
- REDIS_URL=redis://cache
- container=true
command: ["node", "./titan-web/app.js"]
# FROM node:alpine3.11
FROM node:13
WORKDIR /usr/app
RUN wget http://download.redis.io/redis-stable.tar.gz && \
tar xvzf redis-stable.tar.gz && \
cd redis-stable && \
make && \
mv src/redis-server /usr/bin/ && \
cd .. && \
rm -r redis-stable && \
npm install -g concurrently
RUN mkdir -p ./titan-base ./titan-com
COPY ./titan-base/package.json ./titan-base
RUN cd ./titan-base && npm install
COPY ./titan-com/package.json ./titan-com
RUN cd ./titan-com && npm install
COPY ./titan-base ./titan-base
COPY ./titan-com ./titan-com
# CMD ["node","./titan-com/index.js"]
EXPOSE 5101
EXPOSE 5102
EXPOSE 6379
CMD concurrently "/usr/bin/redis-server --bind '0.0.0.0'" "node ./titan-com/index.js"
FROM node:13
WORKDIR /usr/app
RUN mkdir -p ./titan-base ./titan-com
COPY ./titan-base/package.json ./titan-base
RUN cd ./titan-base && npm install
COPY ./titan-com/package.json ./titan-com
RUN cd ./titan-com && npm install
COPY ./titan-base ./titan-base
COPY ./titan-com ./titan-com
# CMD ["node","./titan-com/index.js"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment