myt/server/Dockerfile.server

55 lines
1.1 KiB
Docker
Raw Normal View History

FROM myvc/base
USER root
ENV MYSQL_ROOT_PASSWORD root
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
curl \
&& curl -sL https://deb.nodesource.com/setup_14.x | bash - \
&& apt-get install -y --no-install-recommends \
nodejs \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir /mysql-data \
&& chown -R mysql:mysql /mysql-data
WORKDIR /myvc
COPY \
package.json \
./
RUN npm install --only=prod
COPY \
structure.sql \
myvc.js \
myvc-push.js \
lib.js \
docker.js \
myvc.default.yml \
db.ini \
./
COPY exporters exporters
RUN ln -s /myvc/myvc.js /usr/local/bin/myvc
WORKDIR /workspace
COPY server/docker.cnf /etc/mysql/conf.d/
COPY \
server/docker-init.sh \
server/docker-push.sh \
server/docker-dump.sh \
server/docker-start.sh \
/usr/local/bin/
USER mysql
ENTRYPOINT ["docker-start.sh"]
CMD ["mysqld"]
HEALTHCHECK --interval=2s --timeout=10s --retries=200 \
CMD mysqladmin ping -h 127.0.0.1 -u root --password=root || exit 1