Skip to content

Commit 547d662

Browse files
authored
fix: dockerfile deps and cmd (#37)
- The intl package needs some OS deps - The CMD now correctly starts the server on $PORT
1 parent 19de803 commit 547d662

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

Dockerfile

+11-2
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,20 @@ ARG GA_TRACKING_ID
77
# Define environment variables
88
ENV PORT 3000
99
ENV HOST 0.0.0.0
10-
ENV GA_TRACKING_ID ${GA_TRACKING_ID}
10+
ENV GA_TRACKING_ID $GA_TRACKING_ID
1111

1212
# Define project dir
1313
WORKDIR /usr/src/app
1414

15+
# Install OS deps necessary by some packages (e.g.: node-canvas)
16+
RUN apk add --update --no-cache \
17+
make \
18+
g++ \
19+
jpeg-dev \
20+
cairo-dev \
21+
giflib-dev \
22+
pango-dev
23+
1524
# Install dependencies
1625
COPY package*.json ./
1726
RUN npm install
@@ -24,4 +33,4 @@ RUN npm run build
2433

2534
# Expose port and start command
2635
EXPOSE $PORT
27-
CMD [ "npm", "start" ]
36+
CMD npm start -- -p $PORT

docusaurus/docs/what-is-included/docker.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Example:
2727
ARG SOME_ARGUMENT
2828

2929
# Define environment variables
30-
ENV SOME_ENV_VAR ${SOME_ARGUMENT}
30+
ENV SOME_ENV_VAR $SOME_ARGUMENT
3131
```
3232

3333
You can check the existing `Dockerfile` to see how we're configuring `GA_TRACKING_ID` for an example on this process.

0 commit comments

Comments
 (0)