Skip to content

Commit

Permalink
lock build again
Browse files Browse the repository at this point in the history
  • Loading branch information
Emile Nijssen committed Jan 13, 2022
1 parent bfb9296 commit bbd19b7
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 7 deletions.
37 changes: 33 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,42 @@
FROM docker.io/library/node:16-alpine
# There's an issue with node:16-alpine.
# On Raspberry Pi, the following crash happens:

# Install Linux packages
RUN apk add -U --no-cache wireguard-tools dumb-init
# #FailureMessage Object: 0x7e87753c
# #
# # Fatal error in , line 0
# # unreachable code
# #
# #
# #

FROM docker.io/library/node:14-alpine@sha256:dc92f36e7cd917816fa2df041d4e9081453366381a00f40398d99e9392e78664 AS build_node_modules

# Copy Web UI
COPY src/ /app/
WORKDIR /app
RUN npm ci --production

# Copy build result to a new image.
# This saves a lot of disk space.
FROM docker.io/library/node:14-alpine@sha256:dc92f36e7cd917816fa2df041d4e9081453366381a00f40398d99e9392e78664
COPY --from=build_node_modules /app /app

# Move node_modules one directory up, so during development
# we don't have to mount it in a volume.
# This results in much faster reloading!
#
# Also, some node_modules might be native, and
# the architecture & OS of your development machine might differ
# than what runs inside of docker.
RUN mv /app/node_modules /node_modules

# Enable this to run `npm run serve`
RUN npm i -g nodemon
RUN mv /app/node_modules/ /node_modules/

# Install Linux packages
RUN apk add -U --no-cache \
wireguard-tools \
dumb-init

# Expose Ports
EXPOSE 51820/udp
Expand All @@ -18,4 +46,5 @@ EXPOSE 51821/tcp
ENV DEBUG=Server,WireGuard

# Run Web UI
WORKDIR /app
CMD ["/usr/bin/dumb-init", "node", "server.js"]
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"version": "1.0.0",
"scripts": {
"build": "docker build --tag wg-easy .",
"build": "DOCKER_BUILDKIT=1 docker build --tag wg-easy .",
"serve": "docker-compose -f docker-compose.yml -f docker-compose.dev.yml up",
"start": "docker run --env WG_HOST=0.0.0.0 --name wg-easy --cap-add=NET_ADMIN --cap-add=SYS_MODULE --sysctl=\"net.ipv4.conf.all.src_valid_mark=1\" --mount type=bind,source=\"$(pwd)\"/config,target=/etc/wireguard -p 51820:51820/udp -p 51821:51821/tcp wg-easy"
}
}
}
2 changes: 1 addition & 1 deletion src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
]
},
"engines": {
"node": "16"
"node": "14"
}
}

0 comments on commit bbd19b7

Please sign in to comment.