Create /var/lib/pixa directory in Docker image for database/cache
- Change default StateDir from ./data to /var/lib/pixa (proper Unix convention) - Create directory owned by pixad user in Dockerfile - Set WORKDIR to /var/lib/pixa
This commit is contained in:
@@ -35,9 +35,13 @@ RUN apk add --no-cache \
|
|||||||
# Copy binary from builder
|
# Copy binary from builder
|
||||||
COPY --from=builder /pixad /usr/local/bin/pixad
|
COPY --from=builder /pixad /usr/local/bin/pixad
|
||||||
|
|
||||||
# Create non-root user
|
# Create non-root user and data directory
|
||||||
RUN adduser -D -H -s /sbin/nologin pixad
|
RUN adduser -D -H -s /sbin/nologin pixad && \
|
||||||
|
mkdir -p /var/lib/pixa && \
|
||||||
|
chown pixad:pixad /var/lib/pixa
|
||||||
|
|
||||||
USER pixad
|
USER pixad
|
||||||
|
WORKDIR /var/lib/pixa
|
||||||
|
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import (
|
|||||||
// Default configuration values.
|
// Default configuration values.
|
||||||
const (
|
const (
|
||||||
DefaultPort = 8080
|
DefaultPort = 8080
|
||||||
DefaultStateDir = "./data"
|
DefaultStateDir = "/var/lib/pixa"
|
||||||
DefaultUpstreamConnectionsPerHost = 20
|
DefaultUpstreamConnectionsPerHost = 20
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user