-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
56 lines (34 loc) · 1.03 KB
/
Dockerfile
File metadata and controls
56 lines (34 loc) · 1.03 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
FROM golang:1.16 as BUILDER
LABEL stage=builder
WORKDIR /app/decafans-server
COPY go.mod .
COPY go.sum .
RUN go mod download
COPY src src
RUN CGO_ENABLED=0 GOOS=linux go build -o ../main ./src
RUN mv ./src/templates ../templates && mv ./src/resources ../resources
FROM node:alpine as COMPILER
WORKDIR /app
RUN npm install --global sass
COPY sass sass
COPY package.json package.json
COPY package-lock.json package-lock.json
RUN mkdir css
RUN npm install
RUN sass --no-source-map sass/main.sass css/main.css --style compressed
RUN sass --no-source-map sass/submitter.sass css/poster.css --style compressed
FROM alpine:latest
LABEL maintainer="zivoy"
WORKDIR /root/
COPY --from=BUILDER /app/main app
COPY --from=BUILDER /app/templates templates
COPY --from=BUILDER /app/resources resources
COPY --from=COMPILER /app/css resources/css
# load the config from a local file rather then getting it from the web
ARG LOCAL_FILE=false
ARG VERSION
ENV DEV_MODE=$DEV_MODE
ENV VERSION=$VERSION
LABEL version=$VERSION
EXPOSE 5000
CMD ["./app"]