Browse Source

created docker compose run script for node application

master
jrtechs 4 years ago
parent
commit
9ef6d51110
2 changed files with 33 additions and 3 deletions
  1. +21
    -0
      Dockerfile
  2. +12
    -3
      docker-compose.yml

+ 21
- 0
Dockerfile View File

@ -0,0 +1,21 @@
# jeffery russell 12-17-2020
FROM node:buster-slim
WORKDIR /src/
# installs node dependencies
RUN npm install
ADD package.json package.json
# installs pandoc
RUN apt-get update && \
apt-get install pandoc -y
# exposes port application runs on
EXPOSE 8000
# launch command
CMD npm start

+ 12
- 3
docker-compose.yml View File

@ -10,7 +10,16 @@ services:
restart: always restart: always
environment: environment:
MYSQL_ROOT_PASSWORD: password MYSQL_ROOT_PASSWORD: password
ports:
- "3306:3306"
volumes: volumes:
- "./db:/var/lib/mysql"
- "./db:/var/lib/mysql"
blog:
build: .
volumes:
- ./:/src
ports:
- 8000:8000
restart: always
links:
- db:database

Loading…
Cancel
Save