File size: 1,368 Bytes
e372349
 
 
6336d9f
 
 
 
 
 
 
 
 
 
 
 
77b09f9
 
 
e372349
 
 
 
 
 
6336d9f
 
 
 
e372349
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6336d9f
 
 
 
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
FROM node:22.20-bookworm-slim
ARG NEXT_PUBLIC_VERSION
ENV NEXT_PUBLIC_VERSION=$NEXT_PUBLIC_VERSION

# Set default env variables for local Postgres & Redis inside the container
ENV DATABASE_URL="postgresql://postiz-user:postiz-password@127.0.0.1:5432/postiz-db-local"
ENV REDIS_URL="redis://127.0.0.1:6379"
ENV JWT_SECRET="huggingface-space-secret-jwt-key"
ENV FRONTEND_URL="http://localhost:7860"
ENV MAIN_URL="http://localhost:7860"
ENV NEXT_PUBLIC_BACKEND_URL="http://localhost:7860/api"
ENV BACKEND_INTERNAL_URL="http://localhost:3000"
ENV IS_GENERAL="true"
ENV DISABLE_REGISTRATION="false"

# Avoid interactive prompts from debconf/apt
ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y --no-install-recommends \
    g++ \
    make \
    python3-pip \
    bash \
    nginx \
    postgresql \
    postgresql-contrib \
    redis-server \
    git \
&& rm -rf /var/lib/apt/lists/*

RUN addgroup --system www \
 && adduser --system --ingroup www --home /www --shell /usr/sbin/nologin www \
 && mkdir -p /www \
 && chown -R www:www /www /var/lib/nginx

RUN npm --no-update-notifier --no-fund --global install pnpm@10.6.1 pm2

WORKDIR /app

COPY . /app
COPY var/docker/nginx.conf /etc/nginx/nginx.conf

RUN pnpm install

# Make scripts executable
RUN chmod +x /app/var/docker/start.sh /app/var/docker/backup.sh

CMD ["/app/var/docker/start.sh"]