databag/net/container/Dockerfile

68 lines
2.0 KiB
Docker
Raw Normal View History

2024-03-09 01:54:56 +00:00
FROM ubuntu:20.04 as build
ARG TARGETPLATFORM
2022-01-11 17:56:14 +00:00
LABEL maintainer="roland.osborne@gmail.com"
2022-06-09 04:55:26 +00:00
EXPOSE 7000
2022-01-11 17:56:14 +00:00
ENV TZ=America/Los_Angeles
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
2024-04-05 18:40:44 +00:00
RUN apt-get update
2024-03-09 01:54:56 +00:00
RUN apt-get -y install curl net-tools jq netcat unzip wget git vim fail2ban imagemagick-6.q16 ffmpeg build-essential sqlite3 npm
2022-01-11 17:56:14 +00:00
RUN apt-get -y upgrade
2022-03-10 18:54:09 +00:00
RUN npm install --global yarn
RUN npm install -g n
RUN n stable
2022-06-09 04:55:26 +00:00
RUN mkdir /app
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then ARCHITECTURE=amd64; elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then ARCHITECTURE=arm64; elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then ARCHITECTURE=aarch64; else ARCHITECTURE=unsupported; fi \
2024-04-04 16:32:10 +00:00
&& wget -P /app https://go.dev/dl/go1.22.2.linux-${ARCHITECTURE}.tar.gz \
&& tar -C /usr/local -xzf /app/go1.22.2.linux-${ARCHITECTURE}.tar.gz
2024-03-09 01:54:56 +00:00
RUN git clone https://github.com/balzack/databag.git /app/databag
RUN yarn config set network-timeout 300000
2022-06-09 04:55:26 +00:00
RUN yarn --cwd /app/databag/net/web install
RUN yarn --cwd /app/databag/net/web build
RUN cd /app/databag/net/server; /usr/local/go/bin/go build databag
RUN mkdir /opt/databag
2022-01-11 17:56:14 +00:00
2022-06-09 04:55:26 +00:00
ADD transform /opt/databag/transform
RUN mkdir -p /var/lib/databag
2022-01-11 17:56:14 +00:00
RUN echo 'export PATH=$PATH:/usr/local/go/bin' >> /root/.bashrc
2024-03-09 01:54:56 +00:00
RUN echo "set expandtab\nset tabstop=2\nset softtabstop=2\nset shiftwidth=2\nset encoding=utf-8\nset fileencoding=utf-8\n" > /root/.vimrc
2022-06-09 04:55:26 +00:00
RUN echo "bind 'set mark-symlinked-directories on'" >> /root/.bashrc
ADD entrypoint.sh /app
2024-03-11 03:42:13 +00:00
ADD dev_setup.sh /app
RUN rm -rf /usr/local/go
RUN rm -rf /root/go
RUN rm -rf /app/go*
RUN rm -rf /root/.cache/go*
2022-01-11 17:56:14 +00:00
2024-03-09 01:54:56 +00:00
RUN yarn cache clean
2024-03-11 03:42:13 +00:00
RUN rm -rf /app/databag/app
2024-03-09 01:54:56 +00:00
RUN rm -rf /app/databag/net/web/node_modules
2024-03-11 03:42:13 +00:00
RUN n prune
RUN npm uninstall -g n
RUN rm -rf /usr/local/n
RUN rm -rf /usr/local/bin/node
2024-04-05 18:40:44 +00:00
RUN apt-get -y remove git build-essential npm vim nodejs linux-libc-dev
2024-03-11 03:42:13 +00:00
RUN rm -rf /var/lib/apt/lists
2024-03-09 01:54:56 +00:00
FROM scratch
COPY --from=build / /
2022-06-09 04:55:26 +00:00
ENTRYPOINT ["/app/entrypoint.sh"]
2022-01-11 17:56:14 +00:00