-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
83 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,18 @@ | ||
FROM python:3.6-alpine | ||
|
||
RUN adduser -D instadam | ||
RUN mkdir -p /home/flaskapp/src | ||
WORKDIR /home/flaskapp | ||
|
||
WORKDIR /home/instadam | ||
|
||
COPY requirements requirements | ||
COPY requirements/prod.txt requirements.txt | ||
RUN \ | ||
apk add --no-cache postgresql-libs && \ | ||
apk add --no-cache --virtual .build-deps gcc musl-dev postgresql-dev | ||
|
||
RUN pip install --no-cache-dir -r requirements/prod.txt | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
RUN pip install gunicorn | ||
|
||
RUN apk --purge del .build-deps | ||
|
||
COPY instadam instadam | ||
COPY manage.py ./ | ||
|
||
RUN chown -R instadam:instadam ./ | ||
USER instadam | ||
COPY instadam /home/flaskapp/instadam | ||
COPY manage.py /home/flaskapp | ||
|
||
EXPOSE 5000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
server { | ||
listen 80; | ||
server_name localhost; | ||
|
||
location / { | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
proxy_set_header Host $http_host; | ||
|
||
proxy_pass http://app:8080; | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env bash | ||
rsync -e "ssh -o StrictHostKeyChecking=no" -r --delete-after --quiet $TRAVIS_BUILD_DIR $TRAVIS_SSH_USER@$TRAVIS_SSH_HOST:/tmp/$TRAVIS_BUILD_ID; | ||
ssh -o StrictHostKeyChecking=no $TRAVIS_SSH_USER@$TRAVIS_SSH_HOST -t "sudo source ~/.bashrc;\ | ||
cd ~/InstaDam-backend;\ | ||
sudo docker-compose down;\ | ||
cd /tmp/${TRAVIS_BUILD_ID};\ | ||
sudo rm -rf ~/InstaDam-backend;\ | ||
sudo mv /tmp/${TRAVIS_BUILD_ID}/InstaDam-backend ~/;\ | ||
cd ~/InstaDam-backend;\ | ||
sudo docker-compose --verbose up --build&" |