-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
62 lines (37 loc) · 1019 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# Stage client buid
FROM node:latest as base
WORKDIR /app/client
COPY client/package*.json ./
RUN NODE_ENV=development npm ci
COPY client/ ./
RUN npm run build
# COPY client/ ./dist
FROM golang:1.19 as backend
# RUN mkdir /app
# ADD . /app
WORKDIR /app/backend
COPY backend-server/go.mod backend-server/go.sum ./
RUN go mod download
COPY backend-server ./
ARG credentials
ENV credentials=$credentials
# ADD $credentials /app/backend/credentials.json
# FROM alpine:latest
# RUN apk add --no-cache curl
# RUN curl -sSL https://nixpacks.com/install.sh
# FROM railwayapp/nixpacks:latest as nix
# WORKDIR /app/backend
RUN CGO_ENABLED=0 GOOS=linux go build -o main
FROM golang:1.19
WORKDIR /app
COPY --from=base /app/client/dist ./client/dist
COPY --from=backend /app/backend/main ./
ARG PORT
ENV PORT=$PORT
EXPOSE $PORT
CMD [ "./main" ]
# declare build args
# ARG credentials
# Set environment variables from build args
# ENV railway_creds=$credentials
# COPY $railway_creds /backend/firestore.json