mirror of
https://github.com/fastapi-admin/fastapi-admin.git
synced 2026-03-13 10:32:25 +08:00
add Dockerfile
This commit is contained in:
9
Dockerfile
Normal file
9
Dockerfile
Normal file
@@ -0,0 +1,9 @@
|
||||
FROM python:3
|
||||
RUN mkdir -p /fastapi-admin
|
||||
WORKDIR /fastapi-admin
|
||||
COPY pyproject.toml poetry.lock /fastapi-admin/
|
||||
RUN pip3 install poetry
|
||||
ENV POETRY_VIRTUALENVS_CREATE false
|
||||
RUN poetry install
|
||||
COPY . /fastapi-admin
|
||||
RUN poetry install
|
||||
18
docker-compose.yml
Normal file
18
docker-compose.yml
Normal file
@@ -0,0 +1,18 @@
|
||||
version: '3'
|
||||
services:
|
||||
mysql:
|
||||
image: mariadb
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: 123456
|
||||
healthcheck:
|
||||
test: --health-cmd "mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 10
|
||||
api:
|
||||
build: .
|
||||
environment:
|
||||
DATABASE_URL: mysql://root:123456@mysql:3306/fastapi-admin
|
||||
ports:
|
||||
- '8000:8000'
|
||||
depends_on:
|
||||
- mysql
|
||||
image: prismspay
|
||||
command: uvicorn examples.main:app --port 8000 --host 0.0.0.0
|
||||
@@ -1,9 +0,0 @@
|
||||
FROM python:3
|
||||
RUN mkdir -p /src
|
||||
WORKDIR /src
|
||||
COPY ../pyproject.toml ../poetry.lock /src/
|
||||
RUN pip3 install poetry
|
||||
ENV POETRY_VIRTUALENVS_CREATE false
|
||||
RUN poetry install --no-root
|
||||
COPY . /src
|
||||
|
||||
Reference in New Issue
Block a user