-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
43 lines (29 loc) · 961 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
# # Use an official Node.js image as the base image
FROM node:latest AS build
# Set the working directory in the container
WORKDIR /app
# Copy package.json and package-lock.json to the container from the front end folder
COPY /frontend/package*.json .
# Install dependencies
RUN npm install
RUN npm install -g @angular/cli
# Copy the current directory contents into the container at /app
COPY /frontend .
# Build the Angular app
RUN ng build
# Use an official Golang runtime as a parent image
FROM golang:1.21
# Set the working directory in the container
ENV ROUTE_PREFIX=/s24-illiterate-librarians
# Set the working directory to /backend
WORKDIR /backend
# Copy the current directory contents into the container at /backend
COPY /backend /backend
COPY --from=build /app/dist/frontend/browser .
RUN go get
# Build the Go app
RUN go build -o main .
# Expose port 8080 to the outside world
EXPOSE 8080
# Command to run the executable
CMD ["./main"]