Skip to content

Commit e8bbcca

Browse files
committed
working at Heroku
1 parent 0eba768 commit e8bbcca

File tree

5 files changed

+42
-3
lines changed

5 files changed

+42
-3
lines changed

Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,4 @@ RUN \
1919
ENV DATABASE_URL=postgresql://rxp_user:secret@localhost:5432/rxp_db
2020

2121
WORKDIR /app
22-
CMD service postgresql start && \
23-
python regexplanet-api.py
22+
CMD ./server.sh

deploy.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
#
3+
# deploy the xregexp backend to zeit
4+
#
5+
6+
heroku container:push --app regexplanet-postgresql web
7+
8+
9+
#echo "INFO: listing existing versions"
10+
#now ls regexplanet-postgresql
11+
12+
#echo "INFO: deploying"
13+
#now && now alias
14+
15+
#
16+
# need to kill the old version!
17+
#
18+
#echo "INFO: removing the old version "
19+
#echo "WARNING: must be done manually with 'now rm'"

docker-run.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
4+
docker build -t regexplanet-postgresql .
5+
docker run -p 4000:4000 --expose 4000 -e PORT='4000' regexplanet-postgresql

regexplanet-api.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,4 +303,6 @@ def get(self):
303303

304304
if __name__ == '__main__':
305305
from paste import httpserver
306-
httpserver.serve(app, host='0.0.0.0', port='8080')
306+
port = os.environ['PORT'] if 'PORT' in os.environ else '4000'
307+
sys.stdout.write("INFO: starting on port %s\n" % port)
308+
httpserver.serve(app, host='0.0.0.0', port=port)

server.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
#
3+
# server startup for regexplanet-postgresql
4+
#
5+
6+
echo "INFO: started PostgreSQL..."
7+
service postgresql start
8+
9+
/usr/bin/python --version
10+
11+
echo "INFO: starting python API server..."
12+
/usr/bin/python regexplanet-api.py
13+
14+

0 commit comments

Comments
 (0)