Files
AllMail/webmail/Dockerfile

37 lines
891 B
Docker
Raw Normal View History

2026-05-05 00:47:39 +00:00
FROM node:20-alpine AS builder
WORKDIR /app
COPY spa/package*.json ./
RUN npm install
COPY spa/ .
RUN npm run build
FROM php:8.2-fpm-alpine
RUN apk add --no-cache nginx wget unzip zip libzip-dev \
&& docker-php-ext-install zip
# Install SnappyMail
WORKDIR /var/www/html/mail
RUN wget -O snappymail.zip https://snappymail.eu/repository/latest.zip && \
unzip snappymail.zip && \
rm snappymail.zip && \
find . -type d -exec chmod 755 {} \; && \
find . -type f -exec chmod 644 {} \; && \
chown -R www-data:www-data /var/www/html/mail
# Copy built SPA
COPY --from=builder /app/dist /var/www/html/spa
RUN chown -R www-data:www-data /var/www/html/spa
# Copy configurations
COPY nginx.conf /etc/nginx/nginx.conf
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# Create Nginx run directory
RUN mkdir -p /run/nginx
EXPOSE 80
ENTRYPOINT ["/entrypoint.sh"]