Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added docker support #63

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Docker ci

on:
push:
branches: [ master ]


jobs:

docker:

runs-on: ubuntu-latest

steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v5
with:
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/adolla:latest
cache-from: type=gha
cache-to: type=gha,mode=max
30 changes: 30 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Stage 1: Build the application
FROM node:16-alpine AS builder

WORKDIR /app

COPY package*.json ./

RUN npm install

COPY . .

RUN npm run build

# Stage 2: Run the application
FROM node:16-alpine

WORKDIR /app

COPY --from=builder /app/ .

# Create a non-root user and switch to that user
RUN addgroup -g 1001 adollagroup && adduser -u 1001 -G adollagroup -s /bin/sh -D adolla
USER adolla

# Set environment variables
ENV NODE_ENV production

EXPOSE 8080

CMD ["npm", "start"]
20 changes: 20 additions & 0 deletions compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: '3'
services:
adolla:
build:
context: .
dockerfile: Dockerfile
container_name: "adolla"
restart: unless-stopped
environment:
- PORT=8080 # the port the web app will run on
#- MAXREADINGTOSHOWPOPULAR=10 # the amount of items in "continue reading" required to stop showing "popular" on the home page (for faster loading)
#- IGNOREREADING= #stop storing the progress. Old progress will be kept and shown, but nothing new will be added. Useful for shared servers.
#- TELEGRAMTOKEN= # Telegram bot token to send from
#- TELEGRAMUSER= # Telegram user ID to send new chapters & updates to. Not sure what your ID? Plug in your bot token, start the app, and send the bot a message. Adolla will log your user ID.
#- DISCORDWEBHOOK= # Discord webhook URL to send new chapters & updates to.
#- DISABLE_ANALYTICS= # disable sending a message to me when you start Adolla (useful for me to know how many users I have).
#- IMAGE_PROXY_URL= # the URL to use for image proxy. By default is makes a request in the back-end and pipes the response through. It's recommended you use a third-party proxy on lower powered devices like a Raspberry Pi with 1GB of RAM.
#- DIRSUFFIX= # suffix to add to the .adolla folder (for example, DIRSUFFIX=hi makes .adolla-hi)
ports:
- 8080:8080 # host port: docker port. they can be different.