Skip to content

Commit e0e6a9e

Browse files
committed
Fix(Docker): Align Container Directory Structure with Development Environment
- Standardize workspace directory structure to match local development - Update WORKDIR paths to maintain consistent /neocord root directory - Adjust COPY commands to preserve proper directory hierarchy - Ensure backend commands run from correct directory context
1 parent e3550f2 commit e0e6a9e

1 file changed

Lines changed: 13 additions & 12 deletions

File tree

docker/Dockerfile

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Frontend build stage
44
FROM oven/bun:1 as frontend-builder
5-
WORKDIR /app
5+
WORKDIR /neocord
66

77
# Copy root level package files for better caching
88
COPY package.json bun.lockb ./
@@ -39,7 +39,7 @@ RUN echo "FLASK_APP: ${FLASK_APP}" && \
3939
echo "DATABASE_URL: ${DATABASE_URL}" && \
4040
echo "SCHEMA: ${SCHEMA}"
4141

42-
WORKDIR /app/backend
42+
WORKDIR /neocord
4343

4444
# Non-sensitive build-time configuration
4545
ENV PYTHONDONTWRITEBYTECODE=1
@@ -56,21 +56,22 @@ RUN apk add --no-cache \
5656
musl-dev \
5757
postgresql-client
5858

59-
# Copy dependency files first for better caching
60-
COPY backend/pyproject.toml backend/uv.lock ./
59+
# Copy dependency files for backend
60+
COPY backend/pyproject.toml backend/uv.lock backend/
6161

6262
# Install dependencies using uv with caching
6363
RUN --mount=type=cache,target=/root/.cache/uv \
64-
uv sync --frozen
64+
cd backend && uv sync --frozen
6565

66-
# Copy backend source code
67-
COPY backend/ .
66+
# Copy all source code maintaining directory structure
67+
COPY backend/ backend/
68+
COPY packages/ packages/
6869

69-
# Create the directory structure and copy built frontend
70-
RUN mkdir -p ../../frontend/dist
71-
COPY --from=frontend-builder /app/frontend/dist ../../frontend/dist
70+
# Copy built frontend from builder stage
71+
COPY --from=frontend-builder /neocord/frontend/dist frontend/dist
7272

73-
# Run migrations and start Flask
74-
CMD uv run flask db upgrade && \
73+
# Run migrations and start Flask from backend directory
74+
CMD cd backend && \
75+
uv run flask db upgrade && \
7576
uv run flask seed all && \
7677
uv run gunicorn app:app

0 commit comments

Comments
 (0)