bifurqué depuis fbrinker/docker-tileboard-OUTDATED
540196b488
This fixes the case, where you bind-mount your own tileboard source directory into the dev container. Apparently, the node-sass module is compiled for the specdific machine. This seems to result in the `node-sass` executable not being found in the container, if the `node_modules` folder was compiled on a different machine (OS?). By adding node-sass globally in the container, it can be found even with a bind-mounted `tileboard-source` directory.
36 lignes
799 B
Docker
36 lignes
799 B
Docker
## DEVELOPMENT IMAGE
|
|
FROM node:15-alpine AS dev
|
|
|
|
# Install pre-requisites
|
|
RUN apk add --no-cache git python3
|
|
|
|
# Fetch and build tileboard master branch
|
|
RUN mkdir /tileboard-source \
|
|
&& cd /tileboard-source/ \
|
|
&& git clone https://github.com/resoai/TileBoard . \
|
|
&& git checkout -b my-patch origin/master \
|
|
&& mkdir /tileboard \
|
|
&& ln -s /tileboard build \
|
|
&& yarn install \
|
|
&& npm install --global node-sass \
|
|
&& yarn run build
|
|
|
|
# Start Server
|
|
WORKDIR /tileboard
|
|
EXPOSE 8000
|
|
EXPOSE 8080
|
|
ENTRYPOINT ["/bin/sh", "-c", "yarn --cwd /tileboard-source run dev & python3 -m http.server"]
|
|
|
|
|
|
|
|
## NIGHTLY BUILD IMAGE
|
|
FROM python:alpine AS nightly
|
|
|
|
# Copy contents from dev image
|
|
COPY --from=dev /tileboard /tileboard
|
|
|
|
# Start Server
|
|
WORKDIR /tileboard
|
|
EXPOSE 8000
|
|
ENTRYPOINT python3 -m http.server
|