Skip to content

Commit 1d71a83

Browse files
committed
Some .env magic
1 parent f16c56a commit 1d71a83

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

Dockerfile

+10-3
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
1-
FROM node:12.18.2-alpine3.11
1+
FROM node:12.18.2-alpine3.11 AS deps
22

33
WORKDIR /app
4+
45
COPY ["package.json", "yarn.lock", "./"]
56
COPY src src
67

7-
RUN find src \! -name "package.json" -mindepth 2 -maxdepth 2 -print | xargs rm -rf
8+
RUN find src \! -name "package.json" \
9+
-mindepth 2 \
10+
-maxdepth 2 \
11+
-print \
12+
| xargs rm -rf
813

914
FROM node:12.18.2-alpine3.11
1015

1116
ENV NODE_ENV production
1217

1318
WORKDIR /app
14-
COPY --from=0 /app .
19+
20+
COPY --from=deps /app .
1521

1622
RUN yarn install --frozen-lockfile --production=true
1723

@@ -20,6 +26,7 @@ COPY . .
2026
# To restore workspaces symlinks
2127
RUN yarn install --frozen-lockfile --production=true && \
2228
chmod -R 755 scripts src && \
29+
touch .env && \
2330
touch ~/.env && \
2431
cat crond/crontab >> /var/spool/cron/crontabs/root
2532

0 commit comments

Comments
 (0)