reorganization
- Had to reorganize so that Alembic's env.py could reference the tables in both local environment and a docker environment without manually modifying the python sys path. Maybe there is a better way idk
This commit is contained in:
parent
3670d1522f
commit
a101447eeb
22 changed files with 77 additions and 64 deletions
20
Dockerfile
20
Dockerfile
|
@ -1,19 +1,25 @@
|
|||
FROM python:3.9-alpine
|
||||
|
||||
RUN mkdir -p /app
|
||||
WORKDIR /app
|
||||
|
||||
RUN apk add tzdata build-base libffi-dev py3-cffi --no-cache
|
||||
|
||||
RUN mkdir -p /app/src
|
||||
WORKDIR /app
|
||||
|
||||
ENV TZ=America/New_York
|
||||
ENV VIRTUAL_ENV=/app/env
|
||||
ENV VIRTUAL_ENV=/src/env
|
||||
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
|
||||
ENV BOT_CONFIG_DIR="../config"
|
||||
ENV BOT_DB_URL="sqlite:///../config/sqlite.db"
|
||||
ENV BOT_ALEMBIC_CONFIG="./src/alembic"
|
||||
|
||||
|
||||
RUN python -m venv $VIRTUAL_ENV
|
||||
COPY requirements.txt .
|
||||
COPY requirements.txt /app/
|
||||
RUN pip3 install -r requirements.txt
|
||||
|
||||
COPY ./src/ /app/
|
||||
|
||||
COPY ./src/ /app/src/
|
||||
COPY main.py /app/
|
||||
VOLUME /config
|
||||
|
||||
CMD ["python3", "run.py"]
|
||||
CMD ["python3", "main.py"]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue