Severian commited on
Commit
1d0e45c
·
verified ·
1 Parent(s): dac5c20

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -8
Dockerfile CHANGED
@@ -9,16 +9,23 @@ ENV POETRY_VERSION=1.8.4 \
9
  POETRY_CACHE_DIR=/tmp/poetry_cache \
10
  PYTHONDONTWRITEBYTECODE=1
11
 
12
- # Create directories with correct permissions first (as root)
 
 
 
 
 
 
 
 
13
  RUN mkdir -p /app/api /app/web /data/storage /var/lib/postgresql/data && \
14
  chown -R user:user /app /data && \
15
  chmod 777 /data /app && \
16
  chown -R postgres:postgres /var/lib/postgresql/data && \
17
  chmod 700 /var/lib/postgresql/data
18
 
19
- # Install system dependencies and create user
20
  RUN apt-get update && apt-get install -y \
21
- sudo \
22
  curl \
23
  git \
24
  gcc \
@@ -31,11 +38,7 @@ RUN apt-get update && apt-get install -y \
31
  postgresql \
32
  postgresql-contrib \
33
  && rm -rf /var/lib/apt/lists/* \
34
- && pip install --no-cache-dir "poetry==${POETRY_VERSION}" \
35
- && useradd -m -u 1000 user && \
36
- usermod -aG sudo user && \
37
- echo "user ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers && \
38
- chown -R postgres:postgres /var/lib/postgresql
39
 
40
  # Initialize PostgreSQL database as postgres user
41
  USER postgres
 
9
  POETRY_CACHE_DIR=/tmp/poetry_cache \
10
  PYTHONDONTWRITEBYTECODE=1
11
 
12
+ # Install system dependencies and create user first
13
+ RUN apt-get update && apt-get install -y \
14
+ sudo \
15
+ && rm -rf /var/lib/apt/lists/* \
16
+ && useradd -m -u 1000 user \
17
+ && usermod -aG sudo user \
18
+ && echo "user ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
19
+
20
+ # Create directories and set permissions
21
  RUN mkdir -p /app/api /app/web /data/storage /var/lib/postgresql/data && \
22
  chown -R user:user /app /data && \
23
  chmod 777 /data /app && \
24
  chown -R postgres:postgres /var/lib/postgresql/data && \
25
  chmod 700 /var/lib/postgresql/data
26
 
27
+ # Install remaining system dependencies
28
  RUN apt-get update && apt-get install -y \
 
29
  curl \
30
  git \
31
  gcc \
 
38
  postgresql \
39
  postgresql-contrib \
40
  && rm -rf /var/lib/apt/lists/* \
41
+ && pip install --no-cache-dir "poetry==${POETRY_VERSION}"
 
 
 
 
42
 
43
  # Initialize PostgreSQL database as postgres user
44
  USER postgres