diff options
author | eug-vs <eug-vs@keemail.me> | 2020-11-14 14:30:18 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2020-11-14 14:30:18 +0300 |
commit | 87306ea2e4ffad7b8c588da0423ecf199575ac9c (patch) | |
tree | 06c683005b15818769d4b657eb937c8a73c7f529 | |
parent | b504029067d33aba8b71f696497d4ea03ea19014 (diff) | |
download | bsu-fantom-87306ea2e4ffad7b8c588da0423ecf199575ac9c.tar.gz |
build: dockerize application
-rw-r--r-- | Dockerfile | 16 | ||||
-rw-r--r-- | docker-compose.yml | 23 |
2 files changed, 39 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..7ec96ac --- /dev/null +++ b/Dockerfile @@ -0,0 +1,16 @@ +# Dockerfile to build bsu-fantom image + +FROM node:12 + +WORKDIR /app + +COPY package*.json ./ + +RUN npm install + +COPY . . + +EXPOSE 3030 + +CMD ["npm", "start"] + diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..0986cac --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,23 @@ +# Build and run bsu-fantom with database in container +# +# If you are getting "port already in use" error, +# try changing exposed ports, e.g 27017:27017 -> 27018:27017 + +version: '3' +services: + app: + container_name: bsu-fantom + restart: always + build: . + environment: + - MONGODB_URI=mongodb://db:27017/bsu-fantom + ports: + - '3030:3030' + links: + - db + db: + container_name: mongo + image: mongo + ports: + - '27017:27017' + |