This commit is contained in:
Luke Berndt
2023-11-15 10:22:40 -05:00
parent 8fbe4665ed
commit ef5aa61a11
5 changed files with 11 additions and 15 deletions

View File

@@ -10,7 +10,7 @@ ARG REACT_APP_SITE_NAME
ARG REACT_APP_ADMIN_EMAIL
ARG NODE_ENV
COPY package.json ./
RUN npm install --also=dev
RUN npm install --include=dev
COPY . ./
RUN npm run build
RUN env

View File

@@ -10,7 +10,7 @@ ARG REACT_APP_SITE_NAME
ARG REACT_APP_ADMIN_EMAIL
ARG NODE_ENV
COPY package.json ./
RUN npm install --also=dev
RUN npm install --include=dev
COPY . ./
RUN npm run build

View File

@@ -181,7 +181,3 @@ services:
driver: syslog
options:
tag: "frontend"
networks:
proxy:
node:

View File

@@ -8,7 +8,7 @@ ARG REACT_APP_FRONTEND_SERVER
ARG REACT_APP_GOOGLE_ANALYTICS
ARG NODE_ENV
COPY package.json ./
RUN npm install --also=dev
RUN npm install --include=dev
COPY . ./
RUN npm run build

View File

@@ -10,12 +10,12 @@ fi
# Rest of the script...
if ! [ -x "$(command -v docker-compose)" ]; then
echo 'Error: docker-compose is not installed.' >&2
if ! [ -x "$(command -v docker compose)" ]; then
echo 'Error: docker compose is not installed.' >&2
exit 1
fi
domains=($REACT_APP_FRONTEND_SERVER, $REACT_APP_BACKEND_SERVER, "https://socket.${DOMAIN_NAME}", $REACT_APP_ACCOUNT_SERVER, $REACT_APP_ADMIN_SERVER)
domains=("$DOMAIN_NAME" "account.$DOMAIN_NAME" "admin.$DOMAIN_NAME" "api.$DOMAIN_NAME")
rsa_key_size=4096
data_path="./data/certbot"
@@ -41,7 +41,7 @@ fi
echo "### Creating dummy certificate for $domains ..."
path="/etc/letsencrypt/live/$domains"
mkdir -p "$data_path/conf/live/$domains"
docker-compose run --rm --entrypoint "\
docker compose run --rm --entrypoint "\
openssl req -x509 -nodes -newkey rsa:$rsa_key_size -days 1\
-keyout '$path/privkey.pem' \
-out '$path/fullchain.pem' \
@@ -50,11 +50,11 @@ echo
echo "### Starting nginx ..."
docker-compose up --force-recreate -d nginx
docker compose up -d nginx
echo
echo "### Deleting dummy certificate for $domains ..."
docker-compose run --rm --entrypoint "\
docker compose run --rm --entrypoint "\
rm -Rf /etc/letsencrypt/live/$domains && \
rm -Rf /etc/letsencrypt/archive/$domains && \
rm -Rf /etc/letsencrypt/renewal/$domains.conf" certbot
@@ -77,7 +77,7 @@ esac
# Enable staging mode if needed
if [ $staging != "0" ]; then staging_arg="--staging"; fi
docker-compose run --rm --entrypoint "\
docker compose run --rm --entrypoint "\
certbot certonly --webroot -w /var/www/certbot \
$staging_arg \
$email_arg \
@@ -88,4 +88,4 @@ docker-compose run --rm --entrypoint "\
echo
echo "### Reloading nginx ..."
docker-compose exec nginx nginx -s reload
docker compose exec nginx nginx -s reload