-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38 from oroneta/fix_from_server
hotfix
- Loading branch information
Showing
7 changed files
with
77 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,4 @@ DB_PORT = 5432 | |
PUBLIC_URL = / | ||
|
||
|
||
SERVER_ENV = pro # Or set to pro | ||
SERVER_ENV = dev # [ pro, dev, build ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Build React Website | ||
# FROM node:20.11.1 as build | ||
|
||
# WORKDIR /app | ||
|
||
# # Solve Error: error:0308010C:digital envelope routines::unsupported | ||
# # https://stackoverflow.com/questions/69692842/error-message-error0308010cdigital-envelope-routinesunsupported | ||
# ENV NODE_OPTIONS="--openssl-legacy-provider --max-old-space-size=4096" | ||
|
||
# # Copy source to build | ||
# COPY ./src ./ | ||
|
||
# # Install all dependencies | ||
# RUN npm install | ||
# RUN npm run build | ||
|
||
|
||
# # --------------------------------- | ||
|
||
|
||
# Production | ||
FROM php:8.0.0-apache | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
WORKDIR /var/www/html | ||
|
||
# Remove old | ||
RUN rm -rf ./* | ||
|
||
# Copy from react buld to production server | ||
COPY ./src/build /var/www/html | ||
|
||
# COPY ./www . | ||
|
||
RUN docker-php-ext-install pdo | ||
RUN docker-php-ext-install pdo_mysql | ||
|
||
# Include alternative DB driver | ||
# RUN docker-php-ext-install mysqli | ||
|
||
|
||
RUN apt-get update \ | ||
&& apt-get install -y sendmail libpng-dev \ | ||
&& apt-get install -y libzip-dev \ | ||
&& apt-get install -y zlib1g-dev \ | ||
&& apt-get install -y libonig-dev \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& docker-php-ext-install zip | ||
|
||
|
||
|
||
|
||
|
||
RUN docker-php-ext-install mbstring | ||
RUN docker-php-ext-install zip | ||
RUN docker-php-ext-install gd | ||
|
||
RUN a2enmod rewrite | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Get build files from local, instead building inside docker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,15 @@ | ||
# Build React Website | ||
FROM node:20.11.1 as build | ||
|
||
# Dev pre-production | ||
FROM php:8.0.0-apache | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
WORKDIR /app | ||
|
||
WORKDIR /var/www/html | ||
# Solve Error: error:0308010C:digital envelope routines::unsupported | ||
# https://stackoverflow.com/questions/69692842/error-message-error0308010cdigital-envelope-routinesunsupported | ||
ENV NODE_OPTIONS="--openssl-legacy-provider --max-old-space-size=4096" | ||
|
||
# Copy source to build | ||
COPY ./src ./ | ||
|
||
RUN docker-php-ext-install pdo | ||
RUN docker-php-ext-install pdo_mysql | ||
|
||
# Include alternative DB driver | ||
# RUN docker-php-ext-install mysqli | ||
|
||
|
||
RUN apt-get update \ | ||
&& apt-get install -y sendmail libpng-dev \ | ||
&& apt-get install -y libzip-dev \ | ||
&& apt-get install -y zlib1g-dev \ | ||
&& apt-get install -y libonig-dev \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& docker-php-ext-install zip | ||
|
||
|
||
|
||
RUN docker-php-ext-install mbstring | ||
RUN docker-php-ext-install zip | ||
RUN docker-php-ext-install gd | ||
|
||
RUN a2enmod rewrite | ||
|
||
# Install all dependencies | ||
RUN npm install | ||
CMD ["npm", "run", "start", "&&", "tail", "-f", "/dev/null"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.DS_Store |