-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wip: run docker as unprivileged user #20
- Loading branch information
1 parent
8c58002
commit 2a8ee32
Showing
1 changed file
with
22 additions
and
11 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,21 +1,32 @@ | ||
# Build | ||
FROM node:16.17-bullseye-slim AS builder | ||
ENV HOME /k2 | ||
COPY . ${HOME} | ||
WORKDIR ${HOME} | ||
RUN yarn | ||
|
||
# Copy to slim image | ||
FROM node:16.17-bullseye-slim | ||
LABEL maintainer "<[email protected]>" | ||
|
||
# In case you use an apt proxy somewhere | ||
# RUN printf "Acquire::http::Proxy \"http://pwaite:3142\";" > /etc/apt/apt.conf.d/01local-proxy | ||
|
||
# RUN printf "Acquire::http::Proxy \"http://pwaite:3142\";" > /etc/apt/apt.conf.d/01local-proxy | ||
# Install curl for healthechk purpose | ||
RUN apt-get -y update && apt-get -y install curl gdal-bin | ||
|
||
EXPOSE 8080 | ||
# gdal-bin is required for elevation service | ||
RUN \ | ||
DEBIAN_FRONTEND=noninteractive && \ | ||
apt-get update && \ | ||
apt-get --no-install-recommends --yes install \ | ||
curl \ | ||
ca-certificates \ | ||
gdal-bin && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
ENV HOME /k2 | ||
RUN mkdir ${HOME} | ||
|
||
COPY . ${HOME} | ||
|
||
COPY --from=builder --chown=node:node ${HOME} ${HOME} | ||
WORKDIR ${HOME} | ||
|
||
RUN yarn | ||
|
||
EXPOSE 8080 | ||
USER node | ||
CMD yarn run start |