-
Notifications
You must be signed in to change notification settings - Fork 147
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 #291 from sbs20/staging
Docker build / device discovery / i18n
- Loading branch information
Showing
21 changed files
with
199 additions
and
75 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 |
---|---|---|
|
@@ -7,15 +7,21 @@ COPY package*.json "$APP_DIR/" | |
COPY packages/server/package*.json "$APP_DIR/packages/server/" | ||
COPY packages/client/package*.json "$APP_DIR/packages/client/" | ||
|
||
RUN npm run docker-install | ||
RUN npm run install | ||
|
||
COPY packages/client/ "$APP_DIR/packages/client/" | ||
COPY packages/server/ "$APP_DIR/packages/server/" | ||
|
||
RUN npm run docker-build | ||
RUN npm run build | ||
|
||
# production image | ||
FROM node:14-buster-slim | ||
|
||
# Make it possible to override the UID/GID/username of the user running scanservjs | ||
ARG UID=2001 | ||
ARG GID=2001 | ||
ARG UNAME=scanservjs | ||
|
||
ENV APP_DIR=/app | ||
WORKDIR "$APP_DIR" | ||
RUN apt-get update \ | ||
|
@@ -39,7 +45,8 @@ RUN apt-get update \ | |
&& npm install -g [email protected] | ||
|
||
# Create a known user | ||
RUN useradd -u 2001 -ms /bin/bash scanservjs | ||
RUN groupadd -g $GID -o $UNAME | ||
RUN useradd -o -u $UID -g $GID -m -s /bin/bash $UNAME | ||
|
||
ENV \ | ||
# This goes into /etc/sane.d/net.conf | ||
|
@@ -63,7 +70,7 @@ COPY --from=builder "$APP_DIR/dist" "$APP_DIR/" | |
RUN npm install --production | ||
|
||
# Change the ownership of config and data since we need to write there | ||
RUN chown -R scanservjs:scanservjs config data /etc/sane.d/net.conf /etc/sane.d/airscan.conf | ||
USER scanservjs | ||
RUN chown -R $UID:$GID config data /etc/sane.d/net.conf /etc/sane.d/airscan.conf | ||
USER $UNAME | ||
|
||
EXPOSE 8080 |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Oops, something went wrong.