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
11 changed files
with
9,222 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
env/ | ||
.git/ | ||
__pycache__/ | ||
.vscode/ | ||
.idea | ||
.envrc | ||
.editorconfig | ||
src/ | ||
build/ | ||
node_modules/ | ||
*.dump |
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,30 @@ | ||
name: Duild and deploy Docker container | ||
on: | ||
push: | ||
branches: | ||
- master | ||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Login to DockerHub Registry | ||
run: echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin | ||
- name: Build the tagged Docker image | ||
run: docker build . --file Dockerfile --tag korneevm/moscowpython | ||
- name: Push the tagged Docker image | ||
run: docker push korneevm/moscowpython | ||
- name: login to server and pull container | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
key: ${{ secrets.KEY }} | ||
port: ${{ secrets.PORT }} | ||
script_stop: true | ||
script: | | ||
cd /opt/servers | ||
docker-compose pull moscowpython | ||
docker-compose up -d | ||
docker exec -i servers_moscowpython_1 python3 manage.py migrate --noinput |
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,22 @@ | ||
FROM python:3.7-slim-buster | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt-get update && apt-get install git nodejs npm -y --no-install-recommends | ||
|
||
RUN pip install gunicorn==20.0.4 | ||
|
||
ADD requirements.txt /opt/requirements.txt | ||
RUN pip3 install -r /opt/requirements.txt | ||
|
||
COPY . /opt/app | ||
|
||
WORKDIR /opt/app | ||
|
||
RUN npm install | ||
RUN npx gulp compile | ||
|
||
RUN mkdir -p /opt/staticfiles | ||
RUN python3 manage.py collectstatic --noinput | ||
|
||
CMD ["gunicorn", "-b 0.0.0.0:8000", "moscowdjango.wsgi:application"] |
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
Oops, something went wrong.