-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (32 loc) · 866 Bytes
/
Copy pathDockerfile
File metadata and controls
38 lines (32 loc) · 866 Bytes
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
37
38
# Build node app
FROM node:12-slim AS nodebuild
WORKDIR /opt/simple-auth
COPY package*.json ./
RUN npm ci
COPY webpack.config.js .
COPY vue vue
RUN npm run build
# Build go app
FROM golang:1.15-alpine3.13 AS gobuild
RUN apk add build-base
WORKDIR /opt/simple-auth
COPY go.* ./
RUN go mod download
COPY . .
COPY --from=nodebuild /opt/simple-auth/dist dist
ARG version=docker
ARG buildSha=head
RUN TAG=${version} COMMIT_SHA=${buildSha} make build
# Final image
FROM alpine:latest
WORKDIR /opt/simple-auth
COPY --from=gobuild /opt/simple-auth/bin/simple-auth-server .
COPY --from=gobuild /opt/simple-auth/bin/simple-auth-cli .
VOLUME /var/lib/simple-auth
ENV SA_PRODUCTION=true \
SA_WEB_HOST="0.0.0.0:80" \
SA_DB_URL="/var/lib/simple-auth/simpleauth.db" \
WEB_TLS_CACHE="/var/lib/simple-auth/tls/"
EXPOSE 80
ENTRYPOINT ["./simple-auth-server"]
CMD []