Update Dockerfile
Browse files- Dockerfile +13 -14
Dockerfile
CHANGED
|
@@ -9,26 +9,27 @@ ENV POETRY_VERSION=1.8.4 \
|
|
| 9 |
POETRY_CACHE_DIR=/tmp/poetry_cache \
|
| 10 |
PYTHONDONTWRITEBYTECODE=1
|
| 11 |
|
| 12 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
RUN groupadd -g 1000 user && \
|
| 14 |
useradd -m -u 1000 -g user user && \
|
| 15 |
usermod -aG postgres user
|
| 16 |
|
| 17 |
-
#
|
| 18 |
-
RUN
|
| 19 |
-
postgresql \
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
&& chown -R postgres:postgres /var/run/postgresql /var/lib/postgresql/data /var/log/postgresql \
|
| 23 |
-
&& chmod 2777 /var/run/postgresql \
|
| 24 |
-
&& chmod 700 /var/lib/postgresql/data
|
| 25 |
|
| 26 |
# Create application directories
|
| 27 |
RUN mkdir -p /app/api /app/web /data/storage && \
|
| 28 |
chown -R user:user /app /data && \
|
| 29 |
-
chmod 777 /data /app
|
| 30 |
-
chown -R postgres:postgres /var/lib/postgresql/data && \
|
| 31 |
-
chmod 700 /var/lib/postgresql/data
|
| 32 |
|
| 33 |
# Install remaining system dependencies
|
| 34 |
RUN apt-get update && apt-get install -y \
|
|
@@ -41,8 +42,6 @@ RUN apt-get update && apt-get install -y \
|
|
| 41 |
libmpc-dev \
|
| 42 |
nodejs \
|
| 43 |
npm \
|
| 44 |
-
postgresql \
|
| 45 |
-
postgresql-contrib \
|
| 46 |
&& rm -rf /var/lib/apt/lists/* \
|
| 47 |
&& pip install --no-cache-dir "poetry==${POETRY_VERSION}"
|
| 48 |
|
|
|
|
| 9 |
POETRY_CACHE_DIR=/tmp/poetry_cache \
|
| 10 |
PYTHONDONTWRITEBYTECODE=1
|
| 11 |
|
| 12 |
+
# Install PostgreSQL first to ensure postgres group exists
|
| 13 |
+
RUN apt-get update && apt-get install -y \
|
| 14 |
+
postgresql \
|
| 15 |
+
postgresql-contrib \
|
| 16 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 17 |
+
|
| 18 |
+
# Create users with specific GID/UID for HF Spaces compatibility
|
| 19 |
RUN groupadd -g 1000 user && \
|
| 20 |
useradd -m -u 1000 -g user user && \
|
| 21 |
usermod -aG postgres user
|
| 22 |
|
| 23 |
+
# Set up directories with correct permissions
|
| 24 |
+
RUN mkdir -p /var/run/postgresql /var/lib/postgresql/data /var/log/postgresql && \
|
| 25 |
+
chown -R postgres:postgres /var/run/postgresql /var/lib/postgresql/data /var/log/postgresql && \
|
| 26 |
+
chmod 2777 /var/run/postgresql && \
|
| 27 |
+
chmod 700 /var/lib/postgresql/data
|
|
|
|
|
|
|
|
|
|
| 28 |
|
| 29 |
# Create application directories
|
| 30 |
RUN mkdir -p /app/api /app/web /data/storage && \
|
| 31 |
chown -R user:user /app /data && \
|
| 32 |
+
chmod 777 /data /app
|
|
|
|
|
|
|
| 33 |
|
| 34 |
# Install remaining system dependencies
|
| 35 |
RUN apt-get update && apt-get install -y \
|
|
|
|
| 42 |
libmpc-dev \
|
| 43 |
nodejs \
|
| 44 |
npm \
|
|
|
|
|
|
|
| 45 |
&& rm -rf /var/lib/apt/lists/* \
|
| 46 |
&& pip install --no-cache-dir "poetry==${POETRY_VERSION}"
|
| 47 |
|