Browse Source

Updated docker docs and updated docker container with git

master
jrtechs 2 years ago
parent
commit
b303978cad
2 changed files with 47 additions and 5 deletions
  1. +6
    -4
      Dockerfile
  2. +41
    -1
      README.md

+ 6
- 4
Dockerfile View File

@ -1,18 +1,20 @@
# jeffery russell 12-17-2020
FROM node:buster-slim
WORKDIR /src/
# installs node dependencies
RUN npm install
ADD package.json package.json
RUN npm install
# installs pandoc
# installs pandoc for markdown to html
# need git so admin page can pull blog updates
RUN apt-get update && \
apt-get install pandoc -y
apt-get install pandoc -y && \
apt-get install git -y
# exposes port application runs on
EXPOSE 8000

+ 41
- 1
README.md View File

@ -40,6 +40,30 @@ because you can't run a node application as port 80 unless you are root, which w
security vulnerability.
### Running with Docker
To simplify development and deployment you can run the entire node blog and mysql server from docker using docker-compose.
```bash
docker-compose up
```
or
```bash
docker-compose up db
docker-compose up blog
```
To Access mysql server of docker daemon for maintenence. Note: you need to configure username and password in docker-compose.yml and config.json.
```bash
mysql --port=3306 --host=127.0.0.1 -u root --password=password
```
## Legal
**Unless otherwise stated**, everything in this repository can be
@ -146,4 +170,20 @@ I simply want the project site to be accessible under https://jrtechs.net/projec
### State Diagram of Plan
![diagram](docs/projectsSites.svg)
![diagram](docs/projectsSites.svg)
# DB Backup and Restore
This will dump everything in the database to a plain text file. A base SQL schema can be found in docs//sqlConfig.md
```
sudo mysqldump -u [user] -p [database_name] > [filename].sql
```
This will take a database dump and load it into a active mysql instance.
Note: the database (can be empty) must already exist.
```
sudo mysql -u [user] -p [database_name] < [filename].sql
```

Loading…
Cancel
Save