mirror of
https://github.com/mokuappio/serverless-invoices.git
synced 2025-10-27 07:51:08 -04:00
Add dockerfile and docker documentation in README.md
This commit is contained in:
2
.dockerignore
Normal file
2
.dockerignore
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
node_modules
|
||||||
|
npm-debug.log
|
||||||
30
Dockerfile
Normal file
30
Dockerfile
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
# docker build . -t mokuappio/serverless-invoices
|
||||||
|
# docker run -p 80:8080 -d mokuappio/serverless-invoices
|
||||||
|
|
||||||
|
FROM node:16
|
||||||
|
|
||||||
|
RUN npm install -g http-server
|
||||||
|
|
||||||
|
# Create app directory
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Copy package.json and package-lock.json
|
||||||
|
COPY package*.json ./
|
||||||
|
|
||||||
|
# Install
|
||||||
|
RUN npm install
|
||||||
|
|
||||||
|
# Bundle app source
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
# Copy config (grrrr not written in README!! https://github.com/mokuappio/serverless-invoices/issues/9)
|
||||||
|
COPY src/config/app.config.example.js ./src/config/app.config.js
|
||||||
|
|
||||||
|
# Build the app
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
|
# Choose what port to expose
|
||||||
|
EXPOSE 8080
|
||||||
|
|
||||||
|
# Run the app
|
||||||
|
CMD ["http-server", "dist"]
|
||||||
19
README.md
19
README.md
@ -62,6 +62,25 @@ npm run build
|
|||||||
npm run lint
|
npm run lint
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Run with Docker
|
||||||
|
|
||||||
|
It is necessary to install Docker before running the following commands.
|
||||||
|
|
||||||
|
```
|
||||||
|
git clone https://github.com/mokuappio/serverless-invoices.git
|
||||||
|
cd serverless-invoices.git
|
||||||
|
docker build . -t mokuappio/serverless-invoices
|
||||||
|
docker run -p 80:8080 -d --rm mokuappio/serverless-invoices
|
||||||
|
```
|
||||||
|
|
||||||
|
It is possible to add an alias in your .bashrc/.zshrc file to launch the app on the fly.
|
||||||
|
|
||||||
|
```
|
||||||
|
echo "alias serverless-invoices='docker run -p 80:8080 -d --rm mokuappio/serverless-invoices'" >> ~/.zshrc
|
||||||
|
source ~/.zshrc
|
||||||
|
serverless-invoices
|
||||||
|
```
|
||||||
|
|
||||||
## Topics
|
## Topics
|
||||||
- invoices management
|
- invoices management
|
||||||
- invoicing solution
|
- invoicing solution
|
||||||
|
|||||||
Reference in New Issue
Block a user