-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
56 lines (43 loc) · 1.74 KB
/
Dockerfile
File metadata and controls
56 lines (43 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# =============================================================================
# Feedbackr — Single Container Dockerfile
# =============================================================================
# Builds the React frontend and packages it with PocketBase in one container.
# All collections are auto-created on first boot via migrations.
# =============================================================================
# --- Stage 1: Build frontend ---
FROM node:20-alpine AS frontend-build
WORKDIR /app/frontend
COPY frontend/package*.json ./
RUN npm ci --ignore-scripts
COPY frontend/ ./
# Vite bakes VITE_* at build time — pass via --build-arg or compose
ARG VITE_APP_NAME
ARG VITE_LOGO_URL
ENV VITE_APP_NAME=${VITE_APP_NAME}
ENV VITE_LOGO_URL=${VITE_LOGO_URL}
RUN npm run build
# --- Stage 2: Final image ---
FROM alpine:3.19
ARG POCKETBASE_VERSION=0.25.9
ARG TARGETARCH=amd64
RUN apk add --no-cache \
unzip \
ca-certificates \
wget
# Download PocketBase
RUN wget -q "https://github.com/pocketbase/pocketbase/releases/download/v${POCKETBASE_VERSION}/pocketbase_${POCKETBASE_VERSION}_linux_${TARGETARCH}.zip" \
&& unzip pocketbase_*.zip -d /pb \
&& rm pocketbase_*.zip \
&& chmod +x /pb/pocketbase
# Copy server-side hooks and migrations
COPY pocketbase/pb_hooks /pb/pb_hooks
COPY pocketbase/pb_migrations /pb/pb_migrations
# Copy built frontend as PocketBase static files
COPY --from=frontend-build /app/frontend/dist /pb/pb_public
# Health check
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s \
CMD wget --no-verbose --tries=1 --spider http://localhost:8090/api/health || exit 1
EXPOSE 8090
# Persistent data volume (SQLite DB, uploaded files)
VOLUME /pb/pb_data
CMD ["/pb/pocketbase", "serve", "--http=0.0.0.0:8090"]