mirror of
https://github.com/DarrylNixon/ghostforge
synced 2024-04-22 06:27:20 -07:00
Layout work. Learning how to Alembic.
This commit is contained in:
parent
1fa3d8a372
commit
7598e2c8fc
37 changed files with 806 additions and 173 deletions
37
Dockerfile
37
Dockerfile
|
@ -1,18 +1,37 @@
|
|||
FROM python:3.11-alpine
|
||||
|
||||
ENV DATABASE_PASSWORD ""
|
||||
RUN if [ -z "${DATABASE_PASSWORD}" ]; then echo "ghostforge build error: Set DATABASE_PASSWORD in .env."; exit 1; fi
|
||||
RUN if [ -z "${GHOSTFORGE_JWT_SECRET}" ]; then echo "ghostforge build error: Set GHOSTFORGE_JWT_SECRET in .env."; exit 1; fi
|
||||
# Enforcement to ensure passwords environment variables are not left blank.
|
||||
# This won't stop bad passwords from being used, but at least won't cause
|
||||
# errors or, worse, weaker crypt.
|
||||
ARG POSTGRES_PASSWORD
|
||||
ENV ENV_POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
||||
ARG GHOSTFORGE_JWT_SECRET
|
||||
ENV ENV_GHOSTFORGE_JWT_SECRET=${GHOSTFORGE_JWT_SECRET}
|
||||
RUN [ ! -z "${ENV_POSTGRES_PASSWORD}" ] || { echo "ghostforge build error: Set POSTGRES_PASSWORD in .env."; exit 1; }
|
||||
RUN [ ! -z "${ENV_GHOSTFORGE_JWT_SECRET}" ] || { echo "ghostforge build error: Set GHOSTFORGE_JWT_SECRET in .env."; exit 1; }
|
||||
|
||||
# Create the data directory specified using the environment variables.
|
||||
# This is redundant for mapped volumes, but necessary if the data
|
||||
# directory is specified but not mapped.
|
||||
ARG GHOSTFORGE_DATA_DIR
|
||||
ENV ENV_GHOSTFORGE_DATA_DIR=${GHOSTFORGE_DATA_DIR}
|
||||
RUN mkdir -p "${ENV_GHOSTFORGE_DATA_DIR}"
|
||||
|
||||
# Copy project into Docker image, skipping entries in .dockerignore.
|
||||
WORKDIR /ghostforge
|
||||
COPY . .
|
||||
RUN rm .env
|
||||
RUN mkdir -p "${GHOSTFORGE_DATA_DIR}"
|
||||
|
||||
# Install ghostforge from the work directory.
|
||||
RUN pip install .
|
||||
|
||||
ENV GHOSTFORGE_INTERNAL_WEB_PORT=8080
|
||||
ENV PYTHONPATH=/ghostforge/ghostforge
|
||||
# Expose the web "serve" port specific in the environment variables.
|
||||
ARG GHOSTFORGE_INTERNAL_WEB_PORT
|
||||
ENV ENV_GHOSTFORGE_INTERNAL_WEB_PORT=${GHOSTFORGE_INTERNAL_WEB_PORT}
|
||||
EXPOSE ${ENV_GHOSTFORGE_INTERNAL_WEB_PORT}
|
||||
|
||||
EXPOSE ${GHOSTFORGE_INTERNAL_WEB_PORT}
|
||||
CMD [ "ghostforge_serve" ]
|
||||
# TODO: Is this line necessary?
|
||||
# ENV PYTHONPATH=/ghostforge/ghostforge
|
||||
|
||||
# TODO: Replace with ghostforge_serve when it works.
|
||||
# This currently just keeps the container running for development.
|
||||
CMD [ "python3", "-m", "http.server" ]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue