updated player deployment for digiserver
This commit is contained in:
@@ -15,6 +15,10 @@ RUN apt-get update && \
|
||||
libreoffice-core \
|
||||
libreoffice-impress \
|
||||
libreoffice-writer \
|
||||
sshpass \
|
||||
git \
|
||||
openssh-client \
|
||||
rsync \
|
||||
&& apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
@@ -29,9 +33,8 @@ RUN pip install --no-cache-dir -r requirements.txt
|
||||
# Code is immutable in the image - only data folders are mounted as volumes
|
||||
COPY . .
|
||||
|
||||
# Copy and set permissions for entrypoint script
|
||||
COPY docker-entrypoint.sh /docker-entrypoint.sh
|
||||
RUN chmod +x /docker-entrypoint.sh
|
||||
# Copy and set permissions for entrypoint and setup scripts
|
||||
RUN chmod +x /app/docker-entrypoint.sh /app/setup-player-code.sh
|
||||
|
||||
# Set environment variables
|
||||
ENV FLASK_APP=app.app:create_app
|
||||
@@ -43,7 +46,7 @@ EXPOSE 5000
|
||||
|
||||
# Create a non-root user and grant sudo access for dependency installation
|
||||
RUN useradd -m -u 1000 appuser && \
|
||||
chown -R appuser:appuser /app /docker-entrypoint.sh && \
|
||||
chown -R appuser:appuser /app && \
|
||||
echo "Defaults:appuser !requiretty, !use_pty" >> /etc/sudoers && \
|
||||
echo "appuser ALL=(ALL) NOPASSWD: /usr/bin/apt-get" >> /etc/sudoers && \
|
||||
echo "appuser ALL=(ALL) NOPASSWD: /app/install_libreoffice.sh" >> /etc/sudoers && \
|
||||
@@ -57,4 +60,4 @@ HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
|
||||
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:5000/').read()" || exit 1
|
||||
|
||||
# Run the application via entrypoint
|
||||
ENTRYPOINT ["/docker-entrypoint.sh"]
|
||||
ENTRYPOINT ["/app/docker-entrypoint.sh"]
|
||||
|
||||
Reference in New Issue
Block a user