Skip to content

Commit

Permalink
basic docker
Browse files Browse the repository at this point in the history
  • Loading branch information
gunlinux committed May 4, 2024
1 parent e9aff82 commit 8ebe104
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Dockerfile
tmp/*.db
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Dockerfile - this is a comment. Delete me if you want.
FROM python:3.12
WORKDIR /app
COPY requirements.txt /app
RUN pip install -r requirements.txt

RUN apt update
RUN apt install make -y
ENV SQLALCHEMY_DATABASE_URI="sqlite:////app/tmp/dev.db"
COPY . /app
ENV FLASK_APP="blog"
CMD ["make", "run"]
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,18 @@ test-coverage:

check: lint pytest

run:
flask db upgrade
flask run --host="0.0.0.0" --debug

docker-build:
docker build . --tag="gunlinux:0.0.3"

docker:
-docker stop gunlinux
-docker rm gunlinux
docker run -d --name gunlinux -v /home/loki/projects/gunlinux.ru/tmp:/app/tmp -p 5000:5000 gunlinux:0.0.3

docker-shell:
docker exec -it gunlinux bash

0 comments on commit 8ebe104

Please sign in to comment.