Skip to content

Commit

Permalink
Fix Docker All in One (#439)
Browse files Browse the repository at this point in the history
  • Loading branch information
nwmac authored Aug 13, 2020
1 parent 8ad354a commit 2962f50
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
9 changes: 6 additions & 3 deletions deploy/Dockerfile.all-in-one
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@ COPY --chown=stratos:users deploy/all-in-one/config.all-in-one.properties config

ARG USE_PREBUILT_UI=false

USER root
USER stratos
RUN node --version
RUN deploy/all-in-one/src-build.sh

USER stratos

# Generate dev-certs
RUN CERTS_PATH=/home/stratos/dev-certs ./generate_cert.sh

Expand Down Expand Up @@ -137,6 +135,11 @@ RUN if [ "x$CANARY_BUILD" != "x" ] ; then printf "\nFORCE_ENABLE_PERSISTENCE_FEA
# Enable tech preview features if canary build flag is set
RUN if [ "x$CANARY_BUILD" != "x" ] ; then printf "\nENABLE_TECH_PREVIEW=true\n" >> /srv/config.properties ; fi

# Fix dig to resolve localhost to 127.0.0.1
RUN mv /usr/bin/dig /usr/bin/digit
COPY deploy/all-in-one/dig.sh /usr/bin/dig
RUN chmod +x /usr/bin/dig

EXPOSE 443

# Need to be root to bind to port 443
Expand Down
8 changes: 8 additions & 0 deletions deploy/all-in-one/dig.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

HOST="${@: -1}"
if [ "$HOST" == "localhost" ]; then
echo "127.0.0.1"
else
/usr/bin/digit $@
fi
1 change: 0 additions & 1 deletion deploy/all-in-one/src-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ if [ "${USE_PREBUILT_UI}" = "true" ]; then
else
echo "Building frontend"
npm install
npm run customize
npm run build
if [ $? -ne 0 ]; then
echo "Frontend build failed"
Expand Down

0 comments on commit 2962f50

Please sign in to comment.