WASAPhoto/Dockerfile.embedded

35 lines
688 B
Text
Raw Permalink Normal View History

FROM node:lts as ui-builder
2022-12-12 19:05:23 +01:00
### Copy Vue.js code
WORKDIR /app
2022-12-12 19:05:23 +01:00
COPY webui webui
### Build Vue.js into plain HTML/CSS/JS
WORKDIR /app/webui
RUN npm i
RUN npm run build-embed
2022-12-12 19:05:23 +01:00
FROM golang:1.19.1 AS builder
2022-12-12 19:05:23 +01:00
### Copy Go code
WORKDIR /src/
2022-12-12 19:05:23 +01:00
COPY . .
COPY --from=ui-builder /app/webui webui
2022-12-12 19:05:23 +01:00
### Build executables
RUN go build -tags webui -o /app/webapi ./cmd/webapi
2022-12-12 19:05:23 +01:00
### Create final container
FROM debian:bullseye
2022-12-12 19:05:23 +01:00
### Inform Docker about which port is used
EXPOSE 3000 4000
### Copy the build executable from the builder image
WORKDIR /app/
COPY --from=builder /app/webapi ./
2022-12-12 19:05:23 +01:00
### Executable command
CMD ["/app/webapi", "--db-filename", "/data/wasaphoto.db", "--data-path", "/data/data"]