Skip to content

Commit

Permalink
dockerfile: Replace supervisor with entrypoint script (#213)
Browse files Browse the repository at this point in the history
  • Loading branch information
VerifiedJoseph authored Dec 6, 2023
1 parent 73da2e3 commit 23ca57e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@
!/composer.json
!/composer.lock
!/docker/config/*
!/docker/entrypoint.sh
10 changes: 6 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ FROM alpine:3.18.5
# Install packages
RUN apk add --no-cache \
nginx \
supervisor \
php82 \
php82-curl \
php82-mbstring \
Expand All @@ -28,8 +27,11 @@ COPY --chown=nobody /docker/config/nginx.conf /etc/nginx/nginx.conf
# Copy php-fpm config
COPY --chown=nobody /docker/config/fpm-pool.conf /etc/php82/php-fpm.d/www.conf

# Copy supervisord config
COPY --chown=nobody /docker/config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# Copy nginx config
COPY --chown=nobody /docker/config/nginx.conf /etc/nginx/nginx.conf

# Copy entrypoint script
COPY --chown=nobody /docker/entrypoint.sh /entrypoint.sh

# Copy code
COPY --chown=nobody --from=composer /app/ /app
Expand All @@ -44,4 +46,4 @@ RUN chown -R nobody.nobody /run /app /var/lib/nginx /var/log/nginx
RUN rm -r /app/docker && rm /app/composer.*

USER nobody
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
ENTRYPOINT ["/entrypoint.sh"]
2 changes: 1 addition & 1 deletion docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
build: ../
environment:
BVRSS_YOUTUBE_API_KEY: ''
BVRSS_SELF_URL_PATH: 'http://127.0.0.1:8080'
BVRSS_SELF_URL_PATH: 'http://127.0.0.1:8080/'
BVRSS_TIMEZONE: 'Europe/London'
ports:
- '127.0.0.1:8080:8080'
Expand Down
4 changes: 4 additions & 0 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

php-fpm82 -D
nginx -g 'daemon off;'

0 comments on commit 23ca57e

Please sign in to comment.