-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
42 lines (28 loc) · 904 Bytes
/
Dockerfile
File metadata and controls
42 lines (28 loc) · 904 Bytes
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
FROM ghcr.io/hazmi35/node:18-dev-alpine as build-stage
# Prepare pnpm with corepack (experimental feature)
RUN corepack enable && corepack prepare pnpm@latest
# Copy package.json, lockfile and npm config files
COPY package.json pnpm-lock.yaml ./
# Fetch dependencies to virtual store
RUN pnpm fetch
# Install dependencies
RUN pnpm install --offline --frozen-lockfile
# Copy Project files
COPY . .
# Build Next.js Project
RUN pnpm run build
# Prune devDependencies
RUN pnpm prune --production
# Get ready for production
FROM caddy:2-alpine
LABEL name "website"
LABEL maintainer "Anime World Indonesia <dev@animeworld.moe>"
WORKDIR /app
# Copy needed files
COPY --from=build-stage /tmp/build/build ./build
COPY ./.github/docker/Caddyfile ./Caddyfile
# Additional Environment Variables
ENV NODE_ENV production
EXPOSE 80
# Start the app with node
CMD ["/usr/bin/caddy", "run", "/app/Caddyfile"]