Skip to content

Commit 6b97957

Browse files
authored
feat(docker): safer dockerfile (#65)
1 parent bf50f1e commit 6b97957

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

Dockerfile

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,25 @@
1-
FROM haxe:4.3-alpine
2-
WORKDIR /usr/src/app
1+
FROM haxe:4.3-alpine3.22
32

43
RUN apk add nodejs npm git
54

5+
USER 0
6+
RUN addgroup -g 1000 app && adduser -u 1000 -G app -s /bin/sh -D app && mkdir /app
7+
WORKDIR /app
8+
69
COPY res ./res
710
COPY src ./src
811
COPY user ./user
912
COPY build-*.hxml ./
1013
COPY package*.json ./
1114
COPY default-config.json ./
1215

16+
RUN chown -R app:app /app
17+
18+
USER 1000
1319
RUN npm ci;
14-
RUN haxelib install all --always
15-
RUN haxe build-all.hxml
20+
RUN haxelib setup /app \
21+
&& haxelib install all --always && \
22+
haxe build-all.hxml
1623

17-
EXPOSE 4200
24+
ENTRYPOINT [ "npm", "start" ]
1825

19-
CMD npm start

0 commit comments

Comments
 (0)