Add docker-compose.yml (#7966)
parent
df1efe5f96
commit
2f515bac07
@ -1,20 +1,23 @@
|
|||||||
# The base image is the latest 8.x node (LTS)
|
FROM node:lts
|
||||||
FROM node:8.16.1@sha256:a07ce30ff4e6ae7a6f2c2c1abd7b7b293aaee89510569932a68d00b897cbe055
|
|
||||||
|
|
||||||
RUN mkdir -p /usr/src/app
|
RUN mkdir -p /usr/src/app
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
ARG NODE_ENV
|
ARG NODE_ENV
|
||||||
ENV NODE_ENV $NODE_ENV
|
ENV NODE_ENV $NODE_ENV
|
||||||
|
|
||||||
COPY install/package.json /usr/src/app/package.json
|
COPY install/package.json /usr/src/app/package.json
|
||||||
RUN npm install && npm cache clean --force
|
|
||||||
|
RUN npm install --only=prod && \
|
||||||
|
npm cache clean --force
|
||||||
|
|
||||||
COPY . /usr/src/app
|
COPY . /usr/src/app
|
||||||
|
|
||||||
ENV NODE_ENV=production \
|
ENV NODE_ENV=production \
|
||||||
daemon=false \
|
daemon=false \
|
||||||
silent=false
|
silent=false
|
||||||
|
|
||||||
|
EXPOSE 4567
|
||||||
|
|
||||||
CMD ./nodebb start
|
CMD ./nodebb start
|
||||||
|
|
||||||
# the default port for NodeBB is exposed outside the container
|
|
||||||
EXPOSE 4567
|
|
@ -0,0 +1,24 @@
|
|||||||
|
version: '3.5'
|
||||||
|
|
||||||
|
services:
|
||||||
|
node:
|
||||||
|
build: .
|
||||||
|
restart: unless-stopped
|
||||||
|
depends_on:
|
||||||
|
- db
|
||||||
|
expose:
|
||||||
|
- 4567 # use a reverse proxy like Traefik
|
||||||
|
|
||||||
|
db:
|
||||||
|
image: mongo:bionic
|
||||||
|
restart: unless-stopped
|
||||||
|
expose:
|
||||||
|
- 27017
|
||||||
|
environment:
|
||||||
|
MONGO_INITDB_ROOT_USERNAME: root
|
||||||
|
MONGO_INITDB_ROOT_PASSWORD: root
|
||||||
|
volumes:
|
||||||
|
- mongo:/data/db
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
mongo:
|
Loading…
Reference in New Issue