mirror of
https://github.com/notherealmarco/WASAPhoto.git
synced 2025-03-14 06:06:15 +01:00
Add Dockerfile(s) for frontend and backend, renamed the existing one to Dockerfile.embedded
This commit is contained in:
parent
97c1e3e00f
commit
4b66b7a2fa
3 changed files with 38 additions and 0 deletions
22
Dockerfile.backend
Normal file
22
Dockerfile.backend
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
FROM golang:1.19.1 AS builder
|
||||||
|
|
||||||
|
### Copy Go code
|
||||||
|
WORKDIR /src/
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
### Build executables
|
||||||
|
RUN go build -o /app/webapi ./cmd/webapi
|
||||||
|
|
||||||
|
|
||||||
|
### Create final container
|
||||||
|
FROM debian:bullseye
|
||||||
|
|
||||||
|
### 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 ./
|
||||||
|
|
||||||
|
### Executable command
|
||||||
|
CMD ["/app/webapi"]
|
16
Dockerfile.frontend
Normal file
16
Dockerfile.frontend
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
FROM node:lts as builder
|
||||||
|
|
||||||
|
### Copy Vue.js code
|
||||||
|
WORKDIR /app
|
||||||
|
COPY webui webui
|
||||||
|
|
||||||
|
### Build Vue.js into plain HTML/CSS/JS
|
||||||
|
WORKDIR /app/webui
|
||||||
|
RUN npm run build-prod
|
||||||
|
|
||||||
|
|
||||||
|
### Create final container
|
||||||
|
FROM nginx:stable
|
||||||
|
|
||||||
|
### Copy the (built) app from the builder image
|
||||||
|
COPY --from=builder /app/webui/dist /usr/share/nginx/html
|
Loading…
Reference in a new issue