Skip to content

Commit

Permalink
adapted Dockerfile for alpine image
Browse files Browse the repository at this point in the history
  • Loading branch information
addadi committed Dec 9, 2017
1 parent af4623e commit 37af599
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
FROM python:3.5
MAINTAINER Pit Kleyersburg <[email protected]>
FROM alpine:latest

# Install dependencies
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
sudo \
tesseract-ocr tesseract-ocr-eng imagemagick ghostscript unpaper \
&& rm -rf /var/lib/apt/lists/*

# Install python dependencies
RUN mkdir -p /usr/src/paperless
RUN apk --no-cache --update add \
python3 python3-dev gcc musl-dev gnupg zlib-dev jpeg-dev libmagic \
sudo tesseract-ocr imagemagick ghostscript unpaper

## Install python dependencies
RUN python3 -m ensurepip && \
rm -r /usr/lib/python*/ensurepip && \
mkdir -p /usr/src/paperless
WORKDIR /usr/src/paperless
COPY requirements.txt /usr/src/paperless/
RUN pip install --no-cache-dir -r requirements.txt
RUN pip3 install --no-cache-dir -r requirements.txt

# Copy application
RUN mkdir -p /usr/src/paperless/src
Expand All @@ -31,8 +30,8 @@ WORKDIR /usr/src/paperless/src
RUN ./manage.py migrate

# Create user
RUN groupadd -g 1000 paperless \
&& useradd -u 1000 -g 1000 -d /usr/src/paperless paperless \
RUN addgroup -g 1000 paperless \
&& adduser -D -u 1000 -G paperless -h /usr/src/paperless paperless \
&& chown -Rh paperless:paperless /usr/src/paperless

# Set export directory
Expand Down

0 comments on commit 37af599

Please sign in to comment.