Skip to content

Commit

Permalink
Adds simple Dockerfile and docker-compose
Browse files Browse the repository at this point in the history
  • Loading branch information
dudanogueira committed Feb 17, 2022
1 parent 4bf9230 commit 3b67a94
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.git
.github
.hust
*.tgz
dist
log
node_modules
npm-debug.log
tokens
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM node:14-alpine as base
WORKDIR /usr/src/wpp-server
ENV NODE_ENV=production PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
COPY package.json yarn.lock ./
RUN yarn install --production --pure-lockfile && \
yarn cache clean

FROM base as build
WORKDIR /usr/src/wpp-server
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
COPY package.json yarn.lock ./
RUN yarn install --production=false --pure-lockfile && \
yarn cache clean
COPY . .
RUN yarn build


FROM base
WORKDIR /usr/src/wpp-server/
RUN apk add --no-cache chromium
RUN yarn cache clean
COPY . .
COPY --from=build /usr/src/wpp-server/ /usr/src/wpp-server/
EXPOSE 21465
ENTRYPOINT ["node", "dist/server.js"]
14 changes: 14 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: "3.4"

volumes:
wppconnect_tokens: {}

services:
wppconnect:
build:
context: .
volumes:
- ./config.json:/usr/src/wpp-server/config.json
- wppconnect_tokens:/usr/src/wpp-server/tokens
ports:
- "21465:21465"

0 comments on commit 3b67a94

Please sign in to comment.