Skip to content

Commit

Permalink
Fix renewals for docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
OakleyCord committed May 19, 2023
1 parent a1ed301 commit 3d83d0b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,19 @@
# Build the assets that are needed for the frontend. This build stage is then discarded
# since we won't need NodeJS anymore in the future. This Docker image ships a final production
# level distribution of Jexactyl.
FROM --platform=$TARGETOS/$TARGETARCH mhart/alpine-node:16
FROM node:18-alpine
WORKDIR /app
COPY . ./

# Workaround for ssl not working
ENV NODE_OPTIONS=--openssl-legacy-provider

RUN yarn install --frozen-lockfile \
&& yarn run build:production

# Stage 1:
# Build the actual container with all of the needed PHP dependencies that will run the application.
FROM --platform=$TARGETOS/$TARGETARCH php:8.1-fpm-alpine
FROM php:8.1-fpm-alpine
WORKDIR /app
COPY . ./
COPY --from=0 /app/public/assets ./public/assets
Expand All @@ -26,6 +30,7 @@ RUN apk add --no-cache --update ca-certificates dcron curl git supervisor tar un
&& chown -R nginx:nginx .

RUN rm /usr/local/etc/php-fpm.conf \
&& echo "0 0 * * * /usr/local/bin/php /app/artisan p:schedule:renewal >> /dev/null 2>&1" >> /var/spool/cron/crontabs/root \
&& echo "* * * * * /usr/local/bin/php /app/artisan schedule:run >> /dev/null 2>&1" >> /var/spool/cron/crontabs/root \
&& echo "0 23 * * * certbot renew --nginx --quiet" >> /var/spool/cron/crontabs/root \
&& sed -i s/ssl_session_cache/#ssl_session_cache/g /etc/nginx/nginx.conf \
Expand Down

0 comments on commit 3d83d0b

Please sign in to comment.