Build files outside and move in & install only !dev dependencies
This commit is contained in:
13
Dockerfile
13
Dockerfile
@@ -1,20 +1,13 @@
|
|||||||
FROM node:18
|
FROM node:18
|
||||||
LABEL org.opencontainers.image.source https://github.com/KevinMidboe/figlet-http
|
|
||||||
|
|
||||||
RUN mkdir -p /opt/figlet-http/src
|
RUN mkdir -p /opt/figlet-http/lib
|
||||||
|
|
||||||
WORKDIR /opt/figlet-http
|
WORKDIR /opt/figlet-http
|
||||||
|
|
||||||
# COPY src/ src
|
COPY package.json .
|
||||||
# COPY tsconfig.json .
|
|
||||||
# COPY package.json .
|
|
||||||
# COPY yarn.lock .
|
|
||||||
|
|
||||||
COPY lib/ lib
|
COPY lib/ lib
|
||||||
COPY node_modules/ node_modules
|
|
||||||
|
|
||||||
# RUN yarn
|
RUN yarn install --production
|
||||||
# RUN yarn build
|
|
||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
|
||||||
|
|||||||
15
README.md
15
README.md
@@ -56,15 +56,26 @@ Api endpoints `/text` & `/motd` have the following query options:
|
|||||||
|
|
||||||
## Docker install
|
## Docker install
|
||||||
|
|
||||||
Run as a docker container using:
|
Run as a docker container from github container registry:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker run -d \
|
sudo docker run -d \
|
||||||
--name figlet-http \
|
--name figlet-http \
|
||||||
-p 3000:3000 \
|
-p 3000:3000 \
|
||||||
ghcr.io/kevinmidboe/figlet-http
|
ghcr.io/kevinmidboe/figlet-http
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Run as docker locally:
|
||||||
|
```bash
|
||||||
|
yarn build; \
|
||||||
|
sudo docker build -t figlet-http .; \
|
||||||
|
sudo docker run -d \
|
||||||
|
--name figlet-http \
|
||||||
|
-p 3000:3000 \
|
||||||
|
figlet-http
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
## Systemd service
|
## Systemd service
|
||||||
|
|
||||||
Example systemd config for running http server.
|
Example systemd config for running http server.
|
||||||
|
|||||||
@@ -7,8 +7,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"express": "^4.18.2",
|
"express": "^4.18.2",
|
||||||
"figlet": "^1.5.2",
|
"figlet": "^1.5.2"
|
||||||
"typescript": "^4.8.4"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^18.11.2",
|
"@types/node": "^18.11.2",
|
||||||
@@ -16,6 +15,7 @@
|
|||||||
"@typescript-eslint/parser": "^5.40.1",
|
"@typescript-eslint/parser": "^5.40.1",
|
||||||
"eslint": "^8.25.0",
|
"eslint": "^8.25.0",
|
||||||
"eslint-config-airbnb-base": "^15.0.0",
|
"eslint-config-airbnb-base": "^15.0.0",
|
||||||
"eslint-plugin-import": "^2.26.0"
|
"eslint-plugin-import": "^2.26.0",
|
||||||
|
"typescript": "^4.8.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user