Files
my-projects-website/app/docker/web/Dockerfile
T
kor-elf b35f04d220 Replace Unit configuration with Nginx + PHP-FPM setup in Docker
- Remove outdated Unit-based Docker configuration and scripts.
- Introduce Nginx + PHP-FPM stack with environment-based configurations.
- Add custom Nginx setup for frontend-backend routing.
- Update Dockerfiles, Docker Compose, and related scripts for new architecture.
2026-07-15 00:12:32 +05:00

32 lines
742 B
Docker

FROM docker.io/nginx:1.31-alpine AS build
COPY docker/web/conf/default.conf.template /etc/nginx/templates/default.conf.template
COPY docker/web/conf/fastcgi_params /etc/nginx/fastcgi_params
COPY docker/web/start.sh /usr/local/bin/start
RUN chmod 755 /usr/local/bin/start
FROM build AS app_build_for_production
WORKDIR /home/app
COPY application /home/app
RUN apk --no-cache add git nodejs npm \
&& npm install && npm run build \
&& rm -rf /home/app/node_modules
FROM build AS production
COPY --from=app_build_for_production /home/app/public /usr/share/nginx/html
WORKDIR /usr/share/nginx/html
EXPOSE 80
CMD ["/usr/local/bin/start"]
FROM build AS develop
WORKDIR /usr/share/nginx/html
EXPOSE 80
CMD ["/usr/local/bin/start"]