Add docker support

This commit is contained in:
Moe Poi ~ 2023-06-14 16:34:45 +07:00
parent cbc29cfba4
commit 519238a49e
Signed by: moepoi
GPG key ID: 334B501E883409AF
4 changed files with 54 additions and 0 deletions

13
.env.example Normal file
View file

@ -0,0 +1,13 @@
URL = http://127.0.0.1:9286
HOST = localhost
PORT = 9286
DB_HOST =
DB_USER =
DB_PASSWORD =
DB_NAME =
DB_TIMEOUT =
MAIL_HOST =
MAIL_PORT =
MAIL_USER =
MAIL_PASSWORD =
TG_BOT_TOKEN =

18
Dockerfile Normal file
View file

@ -0,0 +1,18 @@
FROM node:16.20
# Create app directory
WORKDIR /app
# Install app dependencies
COPY package*.json ./
RUN npm install
RUN npm ci --omit=dev
# Bundle app source
COPY . .
ARG PORT
EXPOSE ${PORT}
CMD [ "node", "index.js" ]

23
docker-compose.yml Normal file
View file

@ -0,0 +1,23 @@
version: '3.9'
services:
app:
build: .
restart: always
container_name: nekoya_web
env_file: .env
environment:
URL: ${URL}
HOST: ${HOST}
PORT: ${PORT}
DB_HOST: ${DB_HOST}
DB_USER: ${DB_USER}
DB_PASSWORD: ${DB_PASSWORD}
DB_NAME: ${DB_NAME}
DB_TIMEOUT: ${DB_TIMEOUT}
MAIL_HOST: ${MAIL_HOST}
MAIL_PORT: ${MAIL_PORT}
MAIL_USER: ${MAIL_USER}
MAIL_PASSWORD: ${MAIL_PASSWORD}
TG_BOT_TOKEN: ${TG_BOT_TOKEN}
ports:
- "9286:9286"