This commit is contained in:
36
webmail/Dockerfile
Normal file
36
webmail/Dockerfile
Normal file
@@ -0,0 +1,36 @@
|
||||
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"]
|
||||
Reference in New Issue
Block a user