diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..8439b53 --- /dev/null +++ b/.env.example @@ -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 = \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ec231a4 --- /dev/null +++ b/Dockerfile @@ -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" ] \ No newline at end of file diff --git a/config.js.example b/config.js similarity index 100% rename from config.js.example rename to config.js diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..e1fe7c9 --- /dev/null +++ b/docker-compose.yml @@ -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" \ No newline at end of file