NitinBot001 commited on
Commit
6415621
·
verified ·
1 Parent(s): cb6ba46

Upload 3 files

Browse files
Files changed (3) hide show
  1. Dockerfile +67 -0
  2. docker-compose.yaml.txt +262 -0
  3. supervisord.conf +18 -0
Dockerfile ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Dockerfile for running Penpot on Hugging Face Spaces
2
+ # WARNING: This is NOT an official Penpot deployment method
3
+ # Hugging Face Spaces does NOT support Docker-in-Docker or multi-container setups well
4
+ # This is a SIMPLIFIED single-container approach with significant limitations
5
+
6
+ # For production use, please use the official docker-compose setup from:
7
+ # https://raw.githubusercontent.com/penpot/penpot/main/docker/images/docker-compose.yaml
8
+
9
+ FROM penpotapp/frontend:latest
10
+
11
+ # Switch to root to install dependencies
12
+ USER root
13
+
14
+ # Install system dependencies
15
+ RUN apt-get update && apt-get install -y \
16
+ postgresql-15 \
17
+ supervisor \
18
+ wget \
19
+ curl \
20
+ && rm -rf /var/lib/apt/lists/*
21
+
22
+ # Setup PostgreSQL
23
+ RUN mkdir -p /var/lib/postgresql/data && \
24
+ chown -R postgres:postgres /var/lib/postgresql && \
25
+ su - postgres -c "/usr/lib/postgresql/15/bin/initdb -D /var/lib/postgresql/data"
26
+
27
+ # Create assets directory
28
+ RUN mkdir -p /opt/data/assets && chmod -R 755 /opt/data
29
+
30
+ # Environment variables for Penpot
31
+ ENV PENPOT_FLAGS="disable-email-verification enable-prepl-server disable-secure-session-cookies demo-users registration login-with-password" \
32
+ PENPOT_PUBLIC_URI="http://0.0.0.0:7860" \
33
+ PENPOT_DATABASE_URI="postgresql://localhost/penpot" \
34
+ PENPOT_DATABASE_USERNAME="penpot" \
35
+ PENPOT_DATABASE_PASSWORD="penpot" \
36
+ PENPOT_SECRET_KEY="change-this-for-production-use-random-key" \
37
+ PENPOT_HTTP_SERVER_HOST="0.0.0.0" \
38
+ PENPOT_HTTP_SERVER_PORT="7860"
39
+
40
+ # Expose port 7860 (Hugging Face Spaces default)
41
+ EXPOSE 7860
42
+
43
+ # Create startup script
44
+ RUN echo '#!/bin/bash\n\
45
+ set -e\n\
46
+ \n\
47
+ echo "Starting PostgreSQL..."\n\
48
+ su - postgres -c "/usr/lib/postgresql/15/bin/pg_ctl -D /var/lib/postgresql/data -l /var/log/postgresql.log start"\n\
49
+ sleep 5\n\
50
+ \n\
51
+ echo "Creating database..."\n\
52
+ su - postgres -c "psql -c \"CREATE DATABASE penpot;\"" || true\n\
53
+ su - postgres -c "psql -c \"CREATE USER penpot WITH PASSWORD '\''penpot'\'';\"" || true\n\
54
+ su - postgres -c "psql -c \"GRANT ALL PRIVILEGES ON DATABASE penpot TO penpot;\"" || true\n\
55
+ \n\
56
+ echo "Starting Penpot..."\n\
57
+ exec /opt/run.sh\n\
58
+ ' > /start.sh && chmod +x /start.sh
59
+
60
+ CMD ["/start.sh"]
61
+
62
+ # IMPORTANT NOTES:
63
+ # 1. This Dockerfile is NOT suitable for production use
64
+ # 2. Hugging Face Spaces may not support this complex setup
65
+ # 3. For proper deployment, use docker-compose with the official setup
66
+ # 4. This lacks Redis/Valkey, proper backend service, and exporter service
67
+ # 5. Consider using Elestio or dedicated hosting instead
docker-compose.yaml.txt ADDED
@@ -0,0 +1,262 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ## Common flags:
2
+ # demo-users
3
+ # email-verification
4
+ # log-emails
5
+ # log-invitation-tokens
6
+ # login-with-github
7
+ # login-with-gitlab
8
+ # login-with-google
9
+ # login-with-ldap
10
+ # login-with-oidc
11
+ # login-with-password
12
+ # prepl-server
13
+ # registration
14
+ # secure-session-cookies
15
+ # smtp
16
+ # smtp-debug
17
+ # telemetry
18
+ # webhooks
19
+ ##
20
+ ## You can read more about all available flags and other
21
+ ## environment variables here:
22
+ ## https://help.penpot.app/technical-guide/configuration/#penpot-configuration
23
+ #
24
+ # WARNING: if you're exposing Penpot to the internet, you should remove the flags
25
+ # 'disable-secure-session-cookies' and 'disable-email-verification'
26
+ x-flags: &penpot-flags
27
+ PENPOT_FLAGS: disable-email-verification enable-smtp enable-prepl-server disable-secure-session-cookies
28
+
29
+ x-uri: &penpot-public-uri
30
+ PENPOT_PUBLIC_URI: http://localhost:9001
31
+
32
+ x-body-size: &penpot-http-body-size
33
+ # Max body size (30MiB); Used for plain requests, should never be
34
+ # greater than multi-part size
35
+ PENPOT_HTTP_SERVER_MAX_BODY_SIZE: 31457280
36
+
37
+ # Max multipart body size (350MiB)
38
+ PENPOT_HTTP_SERVER_MAX_MULTIPART_BODY_SIZE: 367001600
39
+
40
+ ## Penpot SECRET KEY. It serves as a master key from which other keys for subsystems
41
+ ## (eg http sessions, or invitations) are derived.
42
+ ##
43
+ ## We recommend to use a trully randomly generated
44
+ ## 512 bits base64 encoded string here. You can generate one with:
45
+ ##
46
+ ## python3 -c "import secrets; print(secrets.token_urlsafe(64))"
47
+ x-secret-key: &penpot-secret-key
48
+ PENPOT_SECRET_KEY: change-this-insecure-key
49
+
50
+ networks:
51
+ penpot:
52
+
53
+ volumes:
54
+ penpot_postgres_v15:
55
+ penpot_assets:
56
+ # penpot_traefik:
57
+
58
+ services:
59
+ ## Traefik service declaration example. Consider using it if you are going to expose
60
+ ## penpot to the internet, or a different host than `localhost`.
61
+
62
+ # traefik:
63
+ # image: traefik:v3.3
64
+ # networks:
65
+ # - penpot
66
+ # command:
67
+ # - "--api.insecure=true"
68
+ # - "--entryPoints.web.address=:80"
69
+ # - "--providers.docker=true"
70
+ # - "--providers.docker.exposedbydefault=false"
71
+ # - "--entryPoints.websecure.address=:443"
72
+ # - "--certificatesresolvers.letsencrypt.acme.tlschallenge=true"
73
+ # - "--certificatesresolvers.letsencrypt.acme.email=<EMAIL_ADDRESS>"
74
+ # - "--certificatesresolvers.letsencrypt.acme.storage=/traefik/acme.json"
75
+ # volumes:
76
+ # - "penpot_traefik:/traefik"
77
+ # - "/var/run/docker.sock:/var/run/docker.sock"
78
+ # ports:
79
+ # - "80:80"
80
+ # - "443:443"
81
+
82
+ penpot-frontend:
83
+ image: "penpotapp/frontend:${PENPOT_VERSION:-latest}"
84
+ restart: always
85
+ ports:
86
+ - 9001:8080
87
+
88
+ volumes:
89
+ - penpot_assets:/opt/data/assets
90
+
91
+ depends_on:
92
+ - penpot-backend
93
+ - penpot-exporter
94
+
95
+ networks:
96
+ - penpot
97
+
98
+ # labels:
99
+ # - "traefik.enable=true"
100
+
101
+ # ## HTTPS: example of labels for the case where penpot will be exposed to the
102
+ # ## internet with HTTPS using traefik.
103
+
104
+ # - "traefik.http.routers.penpot-https.rule=Host(`<DOMAIN_NAME>`)"
105
+ # - "traefik.http.routers.penpot-https.entrypoints=websecure"
106
+ # - "traefik.http.routers.penpot-https.tls.certresolver=letsencrypt"
107
+ # - "traefik.http.routers.penpot-https.tls=true"
108
+
109
+ environment:
110
+ << : [*penpot-flags, *penpot-http-body-size]
111
+
112
+ penpot-backend:
113
+ image: "penpotapp/backend:${PENPOT_VERSION:-latest}"
114
+ restart: always
115
+
116
+ volumes:
117
+ - penpot_assets:/opt/data/assets
118
+
119
+ depends_on:
120
+ penpot-postgres:
121
+ condition: service_healthy
122
+ penpot-valkey:
123
+ condition: service_healthy
124
+
125
+ networks:
126
+ - penpot
127
+
128
+ ## Configuration envronment variables for the backend container.
129
+
130
+ environment:
131
+ << : [*penpot-flags, *penpot-public-uri, *penpot-http-body-size, *penpot-secret-key]
132
+
133
+ ## The PREPL host. Mainly used for external programatic access to penpot backend
134
+ ## (example: admin). By default it will listen on `localhost` but if you are going to use
135
+ ## the `admin`, you will need to uncomment this and set the host to `0.0.0.0`.
136
+
137
+ # PENPOT_PREPL_HOST: 0.0.0.0
138
+
139
+ ## Database connection parameters. Don't touch them unless you are using custom
140
+ ## postgresql connection parameters.
141
+
142
+ PENPOT_DATABASE_URI: postgresql://penpot-postgres/penpot
143
+ PENPOT_DATABASE_USERNAME: penpot
144
+ PENPOT_DATABASE_PASSWORD: penpot
145
+
146
+ ## Valkey (or previously redis) is used for the websockets notifications. Don't touch
147
+ ## unless the valkey container has different parameters or different name.
148
+
149
+ PENPOT_REDIS_URI: redis://penpot-valkey/0
150
+
151
+ ## Default configuration for assets storage: using filesystem based with all files
152
+ ## stored in a docker volume.
153
+
154
+ PENPOT_ASSETS_STORAGE_BACKEND: assets-fs
155
+ PENPOT_STORAGE_ASSETS_FS_DIRECTORY: /opt/data/assets
156
+
157
+ ## Also can be configured to to use a S3 compatible storage.
158
+
159
+ # AWS_ACCESS_KEY_ID: <KEY_ID>
160
+ # AWS_SECRET_ACCESS_KEY: <ACCESS_KEY>
161
+ # PENPOT_ASSETS_STORAGE_BACKEND: assets-s3
162
+ # PENPOT_STORAGE_ASSETS_S3_ENDPOINT: <ENDPOINT>
163
+ # PENPOT_STORAGE_ASSETS_S3_BUCKET: <BUKET_NAME>
164
+
165
+ ## Telemetry. When enabled, a periodical process will send anonymous data about this
166
+ ## instance. Telemetry data will enable us to learn how the application is used,
167
+ ## based on real scenarios. If you want to help us, please leave it enabled. You can
168
+ ## audit what data we send with the code available on github.
169
+
170
+ PENPOT_TELEMETRY_ENABLED: true
171
+ PENPOT_TELEMETRY_REFERER: compose
172
+
173
+ ## Example SMTP/Email configuration. By default, emails are sent to the mailcatch
174
+ ## service, but for production usage it is recommended to setup a real SMTP
175
+ ## provider. Emails are used to confirm user registrations & invitations. Look below
176
+ ## how the mailcatch service is configured.
177
+
178
+ PENPOT_SMTP_DEFAULT_FROM: no-reply@example.com
179
+ PENPOT_SMTP_DEFAULT_REPLY_TO: no-reply@example.com
180
+ PENPOT_SMTP_HOST: penpot-mailcatch
181
+ PENPOT_SMTP_PORT: 1025
182
+ PENPOT_SMTP_USERNAME:
183
+ PENPOT_SMTP_PASSWORD:
184
+ PENPOT_SMTP_TLS: false
185
+ PENPOT_SMTP_SSL: false
186
+
187
+ penpot-exporter:
188
+ image: "penpotapp/exporter:${PENPOT_VERSION:-latest}"
189
+ restart: always
190
+
191
+ depends_on:
192
+ penpot-valkey:
193
+ condition: service_healthy
194
+
195
+ networks:
196
+ - penpot
197
+
198
+ environment:
199
+ << : [*penpot-secret-key]
200
+ # Don't touch it; this uses an internal docker network to
201
+ # communicate with the frontend.
202
+ PENPOT_PUBLIC_URI: http://penpot-frontend:8080
203
+
204
+ ## Valkey (or previously Redis) is used for the websockets notifications.
205
+ PENPOT_REDIS_URI: redis://penpot-valkey/0
206
+
207
+ penpot-postgres:
208
+ image: "postgres:15"
209
+ restart: always
210
+ stop_signal: SIGINT
211
+
212
+ healthcheck:
213
+ test: ["CMD-SHELL", "pg_isready -U penpot"]
214
+ interval: 2s
215
+ timeout: 10s
216
+ retries: 5
217
+ start_period: 2s
218
+
219
+ volumes:
220
+ - penpot_postgres_v15:/var/lib/postgresql/data
221
+
222
+ networks:
223
+ - penpot
224
+
225
+ environment:
226
+ - POSTGRES_INITDB_ARGS=--data-checksums
227
+ - POSTGRES_DB=penpot
228
+ - POSTGRES_USER=penpot
229
+ - POSTGRES_PASSWORD=penpot
230
+
231
+ penpot-valkey:
232
+ image: valkey/valkey:8.1
233
+ restart: always
234
+
235
+ healthcheck:
236
+ test: ["CMD-SHELL", "valkey-cli ping | grep PONG"]
237
+ interval: 1s
238
+ timeout: 3s
239
+ retries: 5
240
+ start_period: 3s
241
+
242
+ networks:
243
+ - penpot
244
+
245
+ environment:
246
+ # You can increase the max memory size if you have sufficient resources,
247
+ # although this should not be necessary.
248
+ - VALKEY_EXTRA_FLAGS=--maxmemory 128mb --maxmemory-policy volatile-lfu
249
+
250
+ ## A mailcatch service, used as temporal SMTP server. You can access via HTTP to the
251
+ ## port 1080 for read all emails the penpot platform has sent. Should be only used as a
252
+ ## temporal solution while no real SMTP provider is configured.
253
+
254
+ penpot-mailcatch:
255
+ image: sj26/mailcatcher:latest
256
+ restart: always
257
+ expose:
258
+ - '1025'
259
+ ports:
260
+ - "1080:1080"
261
+ networks:
262
+ - penpot
supervisord.conf ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [supervisord]
2
+ nodaemon=true
3
+ logfile=/var/log/supervisor/supervisord.log
4
+ pidfile=/var/run/supervisord.pid
5
+
6
+ [program:dockerd]
7
+ command=/usr/bin/dockerd
8
+ autostart=true
9
+ autorestart=true
10
+ stderr_logfile=/var/log/dockerd.err.log
11
+ stdout_logfile=/var/log/dockerd.out.log
12
+
13
+ [program:penpot]
14
+ command=bash -c "sleep 15 && cd /app && docker-compose -p penpot -f docker-compose.yaml up"
15
+ autostart=true
16
+ autorestart=true
17
+ stderr_logfile=/var/log/penpot.err.log
18
+ stdout_logfile=/var/log/penpot.out.log