mirror of
https://github.com/alexankitty/Myrient-Search-Engine.git
synced 2026-01-15 08:23:18 -03:00
Docker build and github action test
This commit is contained in:
7
.dockerignore
Normal file
7
.dockerignore
Normal file
@@ -0,0 +1,7 @@
|
||||
node_modules
|
||||
npm-debug.log
|
||||
.env
|
||||
.git
|
||||
.gitignore
|
||||
README.md
|
||||
data
|
||||
31
.github/workflows/docker-publish.yml
vendored
Normal file
31
.github/workflows/docker-publish.yml
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
name: Build and Publish Docker Image
|
||||
|
||||
on:
|
||||
push:
|
||||
# branches:
|
||||
# - main
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Log in to GitHub Container Registry
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: ghcr.io/${{ github.repository }}:latest
|
||||
23
Dockerfile
Normal file
23
Dockerfile
Normal file
@@ -0,0 +1,23 @@
|
||||
# Use Node.js LTS version
|
||||
FROM node:20-slim
|
||||
|
||||
# Create app directory
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
# Copy package files
|
||||
COPY package*.json ./
|
||||
|
||||
# Install dependencies
|
||||
RUN npm install
|
||||
|
||||
# Copy app source
|
||||
COPY . .
|
||||
|
||||
# Create data directory for persistent files
|
||||
RUN mkdir -p /usr/src/app/data
|
||||
|
||||
# Expose the port
|
||||
EXPOSE 8062
|
||||
|
||||
# Start the application
|
||||
CMD ["node", "server.js"]
|
||||
19
docker-compose.yml
Normal file
19
docker-compose.yml
Normal file
@@ -0,0 +1,19 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
myrient-search:
|
||||
build: .
|
||||
ports:
|
||||
- "8062:8062"
|
||||
environment:
|
||||
- PORT=8062
|
||||
- BIND_ADDRESS=0.0.0.0
|
||||
- FORCE_FILE_REBUILD=0
|
||||
- DEBUG=0
|
||||
- NODE_ENV=production
|
||||
- MAX_JOB_QUEUE=1000
|
||||
- MAX_FETCH_JOBS=1000
|
||||
- INSTANCE_NAME=Myrient
|
||||
volumes:
|
||||
- ./data:/usr/src/app/data
|
||||
restart: unless-stopped
|
||||
Reference in New Issue
Block a user