File size: 1,411 Bytes
5d52253
aaa1350
 
 
59793ca
5d52253
 
 
bea6567
96fc133
 
 
 
 
 
 
 
 
 
 
 
 
3531c4c
 
 
5d52253
aaa1350
2020203
3531c4c
 
2020203
 
7f5bd8f
82b3af0
 
 
586da94
5d52253
aaa1350
5d52253
 
b41cee9
 
 
 
 
 
aaa1350
 
5d52253
 
 
 
7f5bd8f
 
 
586da94
bea6567
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
50
51
52
53
54
55
56
57
58
59
# Use the official Metabase image
# FROM metabase/metabase:latest

# Use a specific version of Metabase known to be stable
FROM metabase/metabase:latest

WORKDIR /app

# Create custom Log4j2 configuration that drops all log output
# RUN cat <<'EOF' > /app/log4j2.xml
#<?xml version="1.0" encoding="UTF-8"?>
#<Configuration status="WARN">
#  <Appenders>
#    <Null name="Null"/>
#  </Appenders>
#  <Loggers>
#    <Root level="OFF">
#      <AppenderRef ref="Null"/>
#    </Root>
#  </Loggers>
#</Configuration>
#EOF

# Set Java options for memory management and custom logging
ENV JAVA_OPTS="-XX:+UnlockExperimentalVMOptions -XX:+UseContainerSupport -XX:MaxRAMPercentage=75.0 -Xmx12g -Dlog4j.configurationFile=file:/app/log4j2.xml"

# Set Metabase specific environment variables
ENV MB_DB_TYPE=postgres
ENV MB_EMOJI_IN_LOGS=false
ENV MB_COLORIZE_LOGS=false


ENV MB_JETTY_PORT=7860
ENV MB_ENABLE_EMBEDDING=true
ENV MB_EMBEDDING_APP_ORIGIN=*
ENV MB_JWT_ENABLED=false
ENV MB_PORT=7860

# Create directory for persistent data
RUN mkdir -p /data

# Create plugins directory
RUN mkdir -p /app/plugins

# Ensure correct permissions
RUN chmod -R 777 /app/plugins

# Expose the port Hugging Face Spaces expects
EXPOSE 7860

# Ensure the data directory is a volume
VOLUME /data

# Add permissions for the data directory
RUN chmod -R 777 /data

# Start Metabase using the proper command
ENTRYPOINT ["/app/run_metabase.sh"]