Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,25 @@ FROM suchja/wine

USER root

# Update apt sources and install Go + Xvfb
# Update sources and install packages
RUN sed -i 's|http://deb.debian.org|http://archive.debian.org|g' /etc/apt/sources.list && \
sed -i 's|http://security.debian.org|http://archive.debian.org|g' /etc/apt/sources.list && \
echo 'Acquire::Check-Valid-Until "false";' > /etc/apt/apt.conf.d/99no-check-valid-until && \
apt-get update && \
apt-get install --allow-unauthenticated --force-yes -y golang xvfb
apt-get install --allow-unauthenticated --force-yes -y golang xvfb xauth x11-utils

# Copy source and build
# Copy app source
COPY . /opt/say
RUN mkdir /opt/say/wavs && chmod 777 /opt/say/wavs
WORKDIR /opt/say
RUN mkdir -p /opt/say/wavs && chmod 777 /opt/say/wavs

# Build Go binary
# Build the Go app
WORKDIR /opt/say
RUN go build

# Run with Xvfb wrapper
CMD ["xvfb-run", "-a", "/opt/say/say"]
# Add entrypoint script
COPY entrypoint.sh /opt/entrypoint.sh
RUN chmod +x /opt/entrypoint.sh

# Set default command
ENTRYPOINT ["/opt/entrypoint.sh"]
CMD ["/opt/say/say"]
20 changes: 20 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

# Set up environment
export DISPLAY=:99
XAUTHORITY=/home/xclient/.Xauthority
export XAUTHORITY

# Create .Xauthority file
mkdir -p $(dirname $XAUTHORITY)
touch $XAUTHORITY
xauth add $DISPLAY . $(mcookie)

# Start Xvfb in background
Xvfb $DISPLAY -screen 0 1024x768x16 &

# Small delay to let Xvfb start
sleep 2

# Run the app
exec "$@"