docker deploy steps
This commit is contained in:
parent
70a982361a
commit
28f496f393
4 changed files with 39 additions and 8 deletions
12
Dockerfile
Normal file
12
Dockerfile
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
# build with nodejs
|
||||||
|
FROM node:16.17.0-bullseye-slim
|
||||||
|
ENV NODE_ENV production
|
||||||
|
WORKDIR /app
|
||||||
|
COPY . /app
|
||||||
|
RUN mkdir -p dist node_modules
|
||||||
|
RUN chown -R node:node .
|
||||||
|
USER node
|
||||||
|
RUN NODE_ENV=development npm ci
|
||||||
|
RUN npm run postinstall
|
||||||
|
RUN npm run prestart
|
||||||
|
CMD ["node", "./app.js"]
|
13
README.md
13
README.md
|
@ -6,13 +6,13 @@ Inspired by [@morganastra](https://twitter.com/morganastra)'s [pronoun.is](https
|
||||||
|
|
||||||
- [NodeJS](https://nodejs.org/en/)
|
- [NodeJS](https://nodejs.org/en/)
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
npm i # Installs Dependencies
|
npm i # Installs Dependencies
|
||||||
```
|
```
|
||||||
|
|
||||||
### Serving Locally
|
### Serving Locally
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
npm start
|
npm start
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -21,11 +21,12 @@ npm start
|
||||||
|
|
||||||
### Deploy
|
### Deploy
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
npm build:css
|
npm run deploy
|
||||||
npm start
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Testing
|
### Testing
|
||||||
|
|
||||||
TODO
|
```sh
|
||||||
|
npm test
|
||||||
|
```
|
||||||
|
|
12
docker-compose.yml
Normal file
12
docker-compose.yml
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
version: "3.9"
|
||||||
|
|
||||||
|
services:
|
||||||
|
app:
|
||||||
|
container_name: pronoun-monster
|
||||||
|
image: pronoun-monster
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
restart: always
|
||||||
|
ports:
|
||||||
|
- "9995:3000"
|
10
package.json
10
package.json
|
@ -5,7 +5,12 @@
|
||||||
"main": "app.js",
|
"main": "app.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"postinstall": "mkdir -p ./dist",
|
"postinstall": "mkdir -p ./dist",
|
||||||
"start": "concurrently npm:serve:*",
|
"start": "node app.js",
|
||||||
|
"prestart": "npm run start:css && npm run start:svg && npm run start:images",
|
||||||
|
"start:css": "tailwindcss -i ./src/app.css -o ./dist/app.css",
|
||||||
|
"start:svg": "npm run build:svg",
|
||||||
|
"start:images": "npm run build:images",
|
||||||
|
"serve": "concurrently npm:serve:*",
|
||||||
"build": "concurrently npm:build:*",
|
"build": "concurrently npm:build:*",
|
||||||
"serve:handlebars": "node app.js",
|
"serve:handlebars": "node app.js",
|
||||||
"serve:css": "tailwindcss -i ./src/app.css -o ./dist/app.css --watch",
|
"serve:css": "tailwindcss -i ./src/app.css -o ./dist/app.css --watch",
|
||||||
|
@ -16,7 +21,8 @@
|
||||||
"build:images": "mkdir -p ./dist ./dist/images && cp ./src/images/* ./dist/images/",
|
"build:images": "mkdir -p ./dist ./dist/images && cp ./src/images/* ./dist/images/",
|
||||||
"test": "ava",
|
"test": "ava",
|
||||||
"lint": "prettier --check .",
|
"lint": "prettier --check .",
|
||||||
"prepare": "husky install"
|
"prepare": "husky install",
|
||||||
|
"deploy": "docker compose up --build -d"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|
Loading…
Add table
Reference in a new issue