add docker configs
This commit is contained in:
parent
335c3dfd3f
commit
59f178402e
|
@ -1,4 +1,4 @@
|
|||
APP_PORT=8080
|
||||
APP_DEBUG=true
|
||||
APP_DEBUG=false
|
||||
|
||||
MAXLEN=5120
|
|
@ -0,0 +1,10 @@
|
|||
FROM node:19
|
||||
|
||||
COPY . /opt/code
|
||||
|
||||
WORKDIR /opt/code
|
||||
|
||||
RUN rm -rf node_modules package_lock.json && \
|
||||
npm install
|
||||
|
||||
CMD [ "/bin/sh", "-c", "/opt/code/run_instance.sh" ]
|
|
@ -2,8 +2,16 @@
|
|||
blek! Bin is a minimalist, privacy-respecting alternative to pastebin.
|
||||
|
||||
# Running an instance
|
||||
### Using npm
|
||||
```bash
|
||||
cp .env.example .env
|
||||
# edit your .env
|
||||
npm run dev/prod
|
||||
```
|
||||
|
||||
### Using docker (recomended)
|
||||
```bash
|
||||
cp .env.example .env
|
||||
# edit your .env
|
||||
docker-compose up -d
|
||||
```
|
|
@ -0,0 +1,11 @@
|
|||
version: '3'
|
||||
|
||||
services:
|
||||
server:
|
||||
build:
|
||||
context: '.'
|
||||
dockerfile: Dockerfile
|
||||
ports:
|
||||
- '${APP_PORT:-8080}:${APP_PORT:-8080}'
|
||||
volumes:
|
||||
- './usercontent:/opt/code/usercontent'
|
|
@ -0,0 +1,13 @@
|
|||
#!/bin/bash
|
||||
|
||||
if ! [ -f .env ]; then
|
||||
echo -e '\033[31m.env not found.'
|
||||
exit -1
|
||||
fi
|
||||
|
||||
. .env
|
||||
if [ "$APP_DEBUG" == "true" ]; then
|
||||
npm run dev
|
||||
else
|
||||
npm run prod
|
||||
fi
|
Loading…
Reference in New Issue