File size: 792 Bytes
e72185f 942acd6 7c5c009 c52f873 3034d2c 7c5c009 0d3304d 7c5c009 c52f873 0d3304d c52f873 0d3304d 3034d2c 942acd6 0d3304d e72185f 0d3304d e72185f 942acd6 e72185f |
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 |
# Use the PostgresML image
FROM ghcr.io/postgresml/postgresml:2.7.12
# Switch to root for initial setup
USER root
# Disable no-new-privileges security feature
RUN sed -i 's/no-new-privileges:true/no-new-privileges:false/' /etc/docker/daemon.json || true
# Create necessary directories
RUN mkdir -p /var/run/postgresql /var/lib/postgresql /home/postgresml/app
# Use the existing postgres user in the image
RUN chown -R postgres:postgres /var/run/postgresql /var/lib/postgresql /home/postgresml/app
# Set working directory
WORKDIR /home/postgresml/app
# Set environment variables
ENV HOME=/home/postgresml/app \
PATH=/home/postgresml/.local/bin:$PATH
# Expose ports
EXPOSE 5432 8000
# Switch to postgres user
USER postgres
# Default command
CMD ["bash", "-c", "psql -d postgresml"] |