-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
36 lines (24 loc) · 1003 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
FROM denoland/deno:alpine
# the group id of the group docker of your docker host
ARG DOCKER_GID="989"
# the port used in the EXPOSE instruction
ARG DOCKER_PORT="3000"
# set 'root' as current user
USER root
# install docker-cli to allow starting containers on host
RUN apk add docker-cli-compose docker-cli-buildx
# create and set working directory
WORKDIR /app
# copy all backend files to working directory
COPY . /app/
# create group 'arsa'(gid 1337) and add user 'deno' to that group
RUN addgroup --gid 1337 arsa && adduser deno arsa
# create folders and set group to 'arsa'(gid 1337)
RUN install -d -m 775 -g arsa /app/profiles && install -d -m 775 -g arsa /app/servers
# create group 'docker'(gid from arg) and add user 'deno' to that group
# this group is defined on the docker host; needs to be adjusted in production
RUN addgroup --gid ${DOCKER_GID} docker && adduser deno docker
# switch to unprivileged user 'deno'
USER deno
EXPOSE ${DOCKER_PORT}
ENTRYPOINT ["deno", "task", "prod"]