mirror of
https://github.com/dnlbauer/pdfact-service.git
synced 2026-09-10 14:15:30 +00:00
initial commit
This commit is contained in:
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
venv
|
||||||
|
.idea
|
||||||
37
Dockerfile
Normal file
37
Dockerfile
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
# build pdfact
|
||||||
|
FROM ubuntu:20.04
|
||||||
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
|
RUN apt-get update -y && apt-get upgrade -y && apt-get install -y maven git
|
||||||
|
|
||||||
|
WORKDIR /
|
||||||
|
RUN git clone https://github.com/ad-freiburg/pdfact.git
|
||||||
|
WORKDIR pdfact
|
||||||
|
|
||||||
|
RUN mvn install -DskipTests
|
||||||
|
|
||||||
|
FROM alpine:latest
|
||||||
|
WORKDIR /
|
||||||
|
|
||||||
|
# copy build artifact
|
||||||
|
COPY --from=0 /pdfact/bin/pdfact.jar pdfact.jar
|
||||||
|
|
||||||
|
# get java
|
||||||
|
RUN apk update \
|
||||||
|
&& apk upgrade \
|
||||||
|
&& apk add --no-cache openjdk11-jre
|
||||||
|
ENV JAVA_HOME="/usr/lib/jvm/java-11-openjdk"
|
||||||
|
|
||||||
|
# get python
|
||||||
|
RUN apk add --no-cache python3 \
|
||||||
|
&& python3 -m ensurepip \
|
||||||
|
&& pip3 install --upgrade pip setuptools
|
||||||
|
|
||||||
|
|
||||||
|
# install flask app
|
||||||
|
WORKDIR /app
|
||||||
|
COPY ./requirements.txt .
|
||||||
|
RUN pip install -r requirements.txt
|
||||||
|
|
||||||
|
COPY app.py .
|
||||||
|
ENTRYPOINT ["python3"]
|
||||||
|
CMD ["app.py"]
|
||||||
12
app.py
Normal file
12
app.py
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
from flask import Flask
|
||||||
|
|
||||||
|
app = Flask(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
@app.route('/', methods=["GET"])
|
||||||
|
def hello_world(): # put application's code here
|
||||||
|
return 'Hello World!'
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
app.run(host="0.0.0.0", port=5000)
|
||||||
1
requirements.txt
Normal file
1
requirements.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Flask==2.2.2
|
||||||
Reference in New Issue
Block a user