forked from mozilla/send
-
Notifications
You must be signed in to change notification settings - Fork 285
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8f4a53d
commit 90f6a07
Showing
8 changed files
with
64 additions
and
29 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 |
---|---|---|
@@ -1,10 +1,8 @@ | ||
node_modules | ||
.git | ||
.tox | ||
.circleci | ||
.nyc_output | ||
.vscode | ||
.DS_Store | ||
firefox | ||
assets | ||
docs | ||
test | ||
coverage | ||
.nyc_output | ||
docs | ||
firefox | ||
node_modules |
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,19 +1,59 @@ | ||
## | ||
# Firefox Send - Mozilla | ||
# | ||
# License https://github.com/mozilla/send/blob/master/LICENSE | ||
## | ||
|
||
|
||
# Build project | ||
FROM node:10 AS builder | ||
RUN addgroup --gid 10001 app && adduser --disabled-password --gecos '' --gid 10001 --home /app --uid 10001 app | ||
COPY package*.json /app/ | ||
RUN set -x \ | ||
# Add user | ||
&& addgroup --gid 10001 app \ | ||
&& adduser --disabled-password \ | ||
--gecos '' \ | ||
--gid 10001 \ | ||
--home /app \ | ||
--uid 10001 \ | ||
app | ||
COPY --chown=app:app . /app | ||
USER app | ||
WORKDIR /app | ||
RUN npm install --production | ||
RUN ls -la | ||
RUN set -x \ | ||
# Build | ||
&& npm ci \ | ||
&& npm run build | ||
|
||
|
||
# Main image | ||
FROM node:10-slim | ||
RUN addgroup --gid 10001 app && adduser --disabled-password --gecos '' --gid 10001 --home /app --uid 10001 app | ||
RUN set -x \ | ||
# Add user | ||
&& addgroup --gid 10001 app \ | ||
&& adduser --disabled-password \ | ||
--gecos '' \ | ||
--gid 10001 \ | ||
--home /app \ | ||
--uid 10001 \ | ||
app | ||
RUN apt-get update && apt-get -y install git-core | ||
USER app | ||
WORKDIR /app | ||
COPY --chown=app:app --from=builder /app . | ||
COPY --chown=app:app . . | ||
COPY --chown=app:app package*.json ./ | ||
COPY --chown=app:app app app | ||
COPY --chown=app:app common common | ||
COPY --chown=app:app public/locales public/locales | ||
COPY --chown=app:app server server | ||
COPY --chown=app:app --from=builder /app/dist dist | ||
|
||
RUN ls -la | ||
RUN npm ci --production && npm cache clean --force | ||
RUN mkdir -p /app/.config/configstore | ||
RUN ln -s dist/version.json version.json | ||
|
||
ENV PORT=1443 | ||
EXPOSE $PORT | ||
|
||
EXPOSE ${PORT} | ||
|
||
CMD ["node", "server/bin/prod.js"] |
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
File renamed without changes.
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,3 +1,7 @@ | ||
# Common Code | ||
|
||
This directory contains code loaded by both the frontend `app` and backend `server`. The code here can be challenging to understand at first because the contexts for the two (three counting the dev server) environments that include them are quite different, but the purpose of these modules are quite simple, to provide mappings from the source assets (`copy-16.png`) to the concrete production assets (`copy-16.db66e0bf.svg`). | ||
This directory contains code loaded by both the frontend `app` and backend `server`. The code here can be challenging to understand at first because the contexts for the two (three counting the dev server) environments that include them are quite different, but the purpose of these modules are quite simple, to provide mappings from the source assets (`copy-16.png`) to the concrete production assets (`copy-16.db66e0bf.svg`). | ||
|
||
## Generate Asset Map | ||
|
||
This loader enumerates all the files in `assets/` so that `common/assets.js` can provide mappings from the source filename to the hashed filename used on the site. |
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