forked from AsifKHasan/doculaboration
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
49 lines (39 loc) · 1.53 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Stage 1: Build Python 3.8 environment
FROM python:3.8 AS builder
# Stage 1: Install necessary system dependencies
RUN apt-get update && \
apt-get install -y \
build-essential \
libpq-dev
# Stage 1: Install Python dependencies
WORKDIR /app
COPY requirements.txt .
RUN pip install --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
# Stage 2: Create final image
FROM ubuntu:latest
# Set environment variable to prevent interactive prompts during package installation
ENV DEBIAN_FRONTEND noninteractive
# Stage 2: Copy binaries
COPY --from=builder /usr/local/ /usr/local/
COPY --from=builder /usr/bin/python3 /usr/bin/python3
# Stage 1: Install necessary system dependencies
RUN apt-get update && \
apt-get install -y \
libreoffice \
libreoffice-script-provider-python \
python3-uno \
poppler-utils
# Stage 2: Set working directory and copy application code
ENV WORKDIR=/doculaboration
WORKDIR ${WORKDIR}
COPY . .
# setup config.yml file
RUN mv $WORKDIR/gsheet-to-json/conf/config.yml.dist $WORKDIR/gsheet-to-json/conf/config.yml
RUN mv $WORKDIR/json-to-context/conf/config.yml.dist $WORKDIR/json-to-context/conf/config.yml
RUN mv $WORKDIR/json-to-docx/conf/config.yml.dist $WORKDIR/json-to-docx/conf/config.yml
RUN mv $WORKDIR/json-to-latex/conf/config.yml.dist $WORKDIR/json-to-latex/conf/config.yml
RUN mv $WORKDIR/json-to-odt/conf/config.yml.dist $WORKDIR/json-to-odt/conf/config.yml
# Give executable permission for .sh files
RUN chmod +x **/*.sh
# FIXME: put the credentail and config folder to the correct directory