Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit c06a3ee

Browse files
Merge pull request #5 from pawelmalak/arm-image
Added docker support for ARM platform
2 parents ff6071e + 60492e6 commit c06a3ee

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

‎Dockerfile.arm‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
FROM node:14-alpine
2+
3+
WORKDIR /app
4+
5+
COPY package*.json ./
6+
7+
RUN apk --no-cache --virtual build-dependencies add python make g++ \
8+
&& npm install
9+
10+
11+
COPY . .
12+
13+
RUN mkdir -p ./public ./data
14+
15+
# Build server code
16+
RUN npm run build
17+
18+
# Build client code
19+
RUN cd ./client \
20+
&& npm install --production \
21+
&& npm run build \
22+
&& cd .. \
23+
&& mv ./client/build/* ./public
24+
25+
# Clean up src files
26+
RUN rm -rf src/ ./client \
27+
&& npm prune --production \
28+
&& apk del build-dependencies
29+
30+
EXPOSE 5000
31+
32+
ENV NODE_ENV=production
33+
34+
CMD ["node", "build/server.js"]

‎README.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,21 @@ npm run dev
4040
#### Building image
4141

4242
```sh
43+
# Building image for Linux
4344
docker build -t snippet-box .
45+
46+
# Build image for ARM
47+
docker buildx build \
48+
--platform linux/arm/v7,linux/arm64 \
49+
-f Dockerfile.arm \
50+
-t snippet-box:arm
4451
```
4552

4653
#### Deployment
4754

4855
```sh
4956
# run container
57+
# for ARM use snippet-box:arm tag
5058
docker run -p 5000:5000 -v /path/to/data:/app/data snippet-box
5159
```
5260

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /