Skip to content
Snippets Groups Projects
Unverified Commit 2c7f3d0f authored by Sebastian Höffner's avatar Sebastian Höffner
Browse files

Separating development and production servers more clearly.

The development server uses docker-compose run and mounts the
app directory. It then runs the flask development server.
The production server uses docker-compose up and runs flask as a
uwsgi app behind nginx. It does not mount app.
parent 0d31349c
No related branches found
No related tags found
No related merge requests found
......@@ -11,6 +11,9 @@ ENV PATH "$OPENCCG_HOME/bin:$PATH"
ENV LD_LIBRARY_PATH "$OPENCCG_HOME/lib:$LD_LIBRARY_PATH"
COPY nginx.conf /etc/nginx/sites-available/occg
COPY app /app
COPY Makefile /Makefile
COPY OpenCCG.ebnf /OpenCCG.ebnf
# Download and extract OpenCCG
RUN curl -o openccg-0.9.5.tgz https://datapacket.dl.sourceforge.net/project/openccg/openccg/openccg%20v0.9.5%20-%20deplen%2C%20kenlm%2C%20disjunctivizer/openccg-0.9.5.tgz \
......@@ -20,14 +23,17 @@ RUN curl -o openccg-0.9.5.tgz https://datapacket.dl.sourceforge.net/project/open
&& curl -O http://www.diaspace.uni-bremen.de/twiki/pub/DiaSpace/ReSources/english.zip \
&& unzip -d /english english.zip \
&& rm english.zip \
# Server software: python 3, nginx, uwsgi
# Server software: python 3, nginx, uwsgi; TatSu to parse the OpenCCG output
&& apt-get update \
&& apt-get install -y python3 python3-pip nginx \
&& pip3 install flask uwsgi tatsu \
# Create the custom TatSu parser
&& make \
# Configure nginx
&& ln -s /etc/nginx/sites-available/occg /etc/nginx/sites-enabled/occg \
&& rm /etc/nginx/sites-enabled/default
# Run Flask app behind nginx
WORKDIR /app
CMD service nginx start \
......
app/openccg_parser.py: OpenCCG.ebnf
tatsu --generate-parser $< --outfile $@
# Runs a development server
.PHONY: run
run:
-docker-compose down
docker-compose build
docker-compose run -p 5000:5000 -v $$(pwd)/app:/app openccg python3 /app/ccgapp.py
......@@ -7,7 +7,3 @@ services:
build: .
ports:
- "8080:80"
volumes:
- type: bind
source: ./app
target: /app
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment