fix: ensure dist files are cleared at container startup
This commit is contained in:
@@ -23,7 +23,7 @@ RUN bun install --frozen-lockfile
|
||||
# Copy all source files
|
||||
COPY . .
|
||||
|
||||
# Build frontend assets (tailwind + ts) from a clean state
|
||||
# Ensure dist is clean at build time (belt + suspenders)
|
||||
RUN rm -rf dist/ && bun run build:assets
|
||||
|
||||
# Generate sqlc code
|
||||
@@ -47,8 +47,8 @@ COPY --from=builder /app/templates ./templates
|
||||
COPY --from=builder /app/static ./static
|
||||
COPY --from=builder /app/dist ./dist
|
||||
COPY --from=builder /app/internal/database/migrations ./migrations
|
||||
COPY docker/entrypoint.sh ./entrypoint.sh
|
||||
|
||||
# Expose the application port
|
||||
EXPOSE 3000
|
||||
|
||||
ENTRYPOINT ["./main_server"]
|
||||
ENTRYPOINT ["./entrypoint.sh"]
|
||||
|
||||
9
docker/entrypoint.sh
Executable file
9
docker/entrypoint.sh
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
echo "[$(date -Iseconds)] Clearing dist/ directory..."
|
||||
rm -rf /app/dist/*
|
||||
echo "[$(date -Iseconds)] dist/ cleared"
|
||||
|
||||
echo "[$(date -Iseconds)] Starting server..."
|
||||
exec /app/main_server
|
||||
Reference in New Issue
Block a user