Skip to content

Commit

Permalink
Merge pull request #3 from pingcap-inc/feat-docker-build
Browse files Browse the repository at this point in the history
feat: docker build
  • Loading branch information
Cheese committed Jun 20, 2024
2 parents 5a9d9d2 + eedcc69 commit fe0ed7d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM python:3.11.9-slim

RUN apt-get update

WORKDIR /app

COPY requirements.txt /app/requirements.txt
RUN PYTHONDONTWRITEBYTECODE=1 pip install --no-cache-dir -r /app/requirements.txt

COPY . /app/

ENV PYTHONPATH /app

EXPOSE 4000

CMD ["python", "manage.py", "runserver", "--port", "4000"]
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.PHONY: build start

build:
docker build -t trans-forum:latest .

start:
docker run -itd \
-p 4000:4000 \
-v .env:/app/.env \
trans-forum:latest

0 comments on commit fe0ed7d

Please sign in to comment.