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
|
||||
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
|
||||
|
||||
# COPY src/ src
|
||||
# COPY tsconfig.json .
|
||||
# COPY package.json .
|
||||
# COPY yarn.lock .
|
||||
|
||||
COPY package.json .
|
||||
COPY lib/ lib
|
||||
COPY node_modules/ node_modules
|
||||
|
||||
# RUN yarn
|
||||
# RUN yarn build
|
||||
RUN yarn install --production
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
|
||||
15
README.md
15
README.md
@@ -56,15 +56,26 @@ Api endpoints `/text` & `/motd` have the following query options:
|
||||
|
||||
## Docker install
|
||||
|
||||
Run as a docker container using:
|
||||
Run as a docker container from github container registry:
|
||||
|
||||
```bash
|
||||
docker run -d \
|
||||
sudo docker run -d \
|
||||
--name figlet-http \
|
||||
-p 3000:3000 \
|
||||
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
|
||||
|
||||
Example systemd config for running http server.
|
||||
|
||||
@@ -7,8 +7,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"express": "^4.18.2",
|
||||
"figlet": "^1.5.2",
|
||||
"typescript": "^4.8.4"
|
||||
"figlet": "^1.5.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^18.11.2",
|
||||
@@ -16,6 +15,7 @@
|
||||
"@typescript-eslint/parser": "^5.40.1",
|
||||
"eslint": "^8.25.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