Spaces:
Runtime error
Runtime error
File size: 555 Bytes
3561597 f491ef3 3561597 f491ef3 3561597 f491ef3 3561597 f491ef3 3561597 f491ef3 3561597 f491ef3 3561597 f491ef3 3561597 |
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 |
FROM postgres:17
# Create user with UID 1000 (required by HF Spaces)
RUN useradd -m -u 1000 user
# Set environment variables
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH \
POSTGRES_PASSWORD=password \
POSTGRES_USER=postgres \
POSTGRES_DB=postgres \
PGDATA=/home/user/pgdata
# Create data directory with correct permissions
RUN mkdir -p /home/user/pgdata && \
chown -R user:user /home/user/pgdata
# Switch to user
USER user
WORKDIR $HOME/app
# Expose PostgreSQL port
EXPOSE 5432
# Start PostgreSQL
CMD ["postgres"]
|