This repository was archived by the owner on Jun 15, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdockerfile-prod
More file actions
67 lines (57 loc) · 1.73 KB
/
dockerfile-prod
File metadata and controls
67 lines (57 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Building the app
FROM node:lts-bookworm AS build
WORKDIR /app
COPY ./app/foodflow .
RUN npm install && npm run build
FROM ubuntu:22.04
EXPOSE 80
SHELL ["/bin/bash", "-c"]
# Environment variables to automatically configure Apache
ENV TERM=xterm
ENV DEBIAN_FRONTEND=noninteractive \
APACHE_RUN_USER=www-data \
APACHE_RUN_GROUP=www-data \
APACHE_LOG_DIR=/var/log/apache2 \
APACHE_PID_FILE=/var/run/apache2/apache2.pid \
APACHE_RUN_DIR=/var/run/apache2 \
APACHE_LOCK_DIR=/var/lock/apache2
RUN mkdir -p /var/run/apache2 /var/lock/apache2
# Apache, PHP and dependencies installation
RUN apt update && \
apt install -y software-properties-common curl gnupg2 lsb-release ca-certificates && \
add-apt-repository ppa:ondrej/php && \
apt update && \
apt install -y \
apache2 \
php8.4 \
php8.4-cli \
libapache2-mod-php8.4 \
php8.4-common \
php8.4-ctype \
php8.4-curl \
php8.4-dom \
php8.4-fileinfo \
# php8.4-filter \
# php8.4-hash \
php8.4-mbstring \
# php8.4-openssl \
# php8.4-pcre \
php8.4-pdo \
# php8.4-session \
php8.4-tokenizer \
php8.4-xml \
php8.4-mysql \
unzip git
# Composer installation
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Apache configuration
RUN a2enmod rewrite
WORKDIR /var/www/html
COPY --from=build /app .
# Neccesary to prevent vite trying to hot reload
RUN rm -f ./public/hot
RUN chown -R www-data:www-data /var/www/html
COPY ./apache.conf /etc/apache2/sites-enabled/000-default.conf
# Composer dependencies
RUN composer install --no-interaction --prefer-dist --optimize-autoloader
# CMD ["apachectl", "-D", "FOREGROUND"]