mirror of
https://github.com/penpot/penpot.git
synced 2025-07-19 08:17:30 +02:00
♻️ Refactor on docker and build scripts.
- Migrate to from ubuntu to debian. - Add new buildenv image. - Remove production images building from this repo. - Better comaptibility with other architectures (arm64). - Improved config management.
This commit is contained in:
parent
655c7ae023
commit
f57ce57cb3
26 changed files with 400 additions and 5348 deletions
|
@ -1,4 +1,4 @@
|
|||
FROM ubuntu:bionic
|
||||
FROM debian:buster
|
||||
LABEL maintainer="Andrey Antukh <niwi@niwi.nz>"
|
||||
|
||||
ARG EXTERNAL_UID=1000
|
||||
|
@ -9,6 +9,10 @@ ENV NODE_VERSION=v12.14.1 \
|
|||
LANG=en_US.UTF-8 \
|
||||
LC_ALL=C.UTF-8
|
||||
|
||||
RUN set -ex; \
|
||||
mkdir -p /etc/resolvconf/resolv.conf.d; \
|
||||
echo "nameserver 8.8.8.8" > /etc/resolvconf/resolv.conf.d/tail;
|
||||
|
||||
RUN set -ex; \
|
||||
apt-get update && \
|
||||
apt-get install -yq \
|
||||
|
@ -24,45 +28,17 @@ RUN set -ex; \
|
|||
bash \
|
||||
git \
|
||||
rlwrap \
|
||||
python \
|
||||
build-essential \
|
||||
imagemagick \
|
||||
webp \
|
||||
openjdk-11-jdk \
|
||||
; \
|
||||
rm -rf /var/lib/apt/lists/*;
|
||||
|
||||
RUN set -ex; \
|
||||
mkdir -p /etc/resolvconf/resolv.conf.d; \
|
||||
echo "nameserver 8.8.8.8" > /etc/resolvconf/resolv.conf.d/tail; \
|
||||
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0xB1998361219BD9C9; \
|
||||
curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -; \
|
||||
echo "deb http://repos.azulsystems.com/ubuntu stable main" >> /etc/apt/sources.list.d/zulu.list; \
|
||||
echo "deb http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main" >> /etc/apt/sources.list.d/postgresql.list;
|
||||
|
||||
|
||||
RUN set -ex; \
|
||||
apt-get -qq update; \
|
||||
apt-get install -qqy zulu-12; \
|
||||
apt-get install -qqy \
|
||||
postgresql-12 \
|
||||
postgresql-contrib-12 \
|
||||
;\
|
||||
rm -rf /var/lib/apt/lists/*;
|
||||
|
||||
COPY files/pg_hba.conf /etc/postgresql/12/main/pg_hba.conf
|
||||
COPY files/bashrc /root/.bashrc
|
||||
COPY files/vimrc /root/.vimrc
|
||||
|
||||
RUN set -ex; \
|
||||
/etc/init.d/postgresql start \
|
||||
&& createuser -U postgres -sl uxbox \
|
||||
&& createdb -U uxbox uxbox \
|
||||
&& createdb -U uxbox test \
|
||||
&& /etc/init.d/postgresql stop
|
||||
|
||||
EXPOSE 3449
|
||||
EXPOSE 6060
|
||||
EXPOSE 9090
|
||||
|
||||
RUN set -ex; \
|
||||
useradd -m -g users -s /bin/zsh -u $EXTERNAL_UID uxbox; \
|
||||
passwd uxbox -d; \
|
||||
|
@ -77,12 +53,7 @@ RUN set -ex; \
|
|||
USER uxbox
|
||||
WORKDIR /home/uxbox
|
||||
|
||||
RUN set -ex; \
|
||||
git clone https://github.com/creationix/nvm.git .nvm; \
|
||||
bash -c "source .nvm/nvm.sh && nvm install $NODE_VERSION"; \
|
||||
bash -c "source .nvm/nvm.sh && nvm alias default $NODE_VERSION"; \
|
||||
bash -c "source .nvm/nvm.sh && nvm use default";
|
||||
|
||||
COPY files/package.json /home/uxbox/package.json
|
||||
COPY files/bashrc /home/uxbox/.bashrc
|
||||
COPY files/zshrc /home/uxbox/.zshrc
|
||||
COPY files/vimrc /home/uxbox/.vimrc
|
||||
|
@ -91,5 +62,18 @@ COPY files/tmux.conf /home/uxbox/.tmux.conf
|
|||
COPY files/entrypoint.sh /home/uxbox/
|
||||
COPY files/init.sh /home/uxbox/
|
||||
|
||||
RUN set -ex; \
|
||||
git clone https://github.com/creationix/nvm.git .nvm; \
|
||||
bash -c "source .nvm/nvm.sh && nvm install $NODE_VERSION"; \
|
||||
bash -c "source .nvm/nvm.sh && nvm alias default $NODE_VERSION"; \
|
||||
bash -c "source .nvm/nvm.sh && nvm use default";
|
||||
|
||||
RUN set -ex; \
|
||||
bash -c "source .nvm/nvm.sh && npm install";
|
||||
|
||||
EXPOSE 3449
|
||||
EXPOSE 6060
|
||||
EXPOSE 9090
|
||||
|
||||
ENTRYPOINT ["zsh", "/home/uxbox/entrypoint.sh"]
|
||||
CMD ["/home/uxbox/init.sh"]
|
||||
|
|
|
@ -14,10 +14,9 @@ volumes:
|
|||
services:
|
||||
main:
|
||||
privileged: true
|
||||
build:
|
||||
context: ./
|
||||
hostname: 'uxboxdev-main'
|
||||
container_name: 'uxboxdev-main'
|
||||
image: "uxbox-devenv"
|
||||
hostname: 'uxbox-devenv-main'
|
||||
container_name: 'uxbox-devenv-main'
|
||||
command: "/home/uxbox/init.sh"
|
||||
stop_signal: SIGINT
|
||||
depends_on:
|
||||
|
@ -25,9 +24,8 @@ services:
|
|||
- smtp
|
||||
volumes:
|
||||
- "user_data:/home/uxbox/local"
|
||||
- "${PWD}:/home/uxbox/uxbox"
|
||||
- "${HOME}/.m2:/home/uxbox/.m2"
|
||||
- "${HOME}/.gitconfig:/home/uxbox/.gitconfig"
|
||||
- "${PWD}:/home/uxbox/uxbox"
|
||||
|
||||
ports:
|
||||
- 3449:3449
|
||||
|
@ -35,13 +33,13 @@ services:
|
|||
- 9090:9090
|
||||
|
||||
environment:
|
||||
- CLOJURE_OPTS="-J-XX:-OmitStackTraceInFastThrow"
|
||||
- UXBOX_DATABASE_URI="postgresql://postgres/uxbox"
|
||||
- UXBOX_DATABASE_USERNAME="uxbox"
|
||||
- UXBOX_DATABASE_PASSWORD="uxbox"
|
||||
- CLOJURE_OPTS=-J-XX:-OmitStackTraceInFastThrow
|
||||
- UXBOX_DATABASE_URI=postgresql://postgres/uxbox
|
||||
- UXBOX_DATABASE_USERNAME=uxbox
|
||||
- UXBOX_DATABASE_PASSWORD=uxbox
|
||||
|
||||
smtp:
|
||||
container_name: 'uxboxdev-smtp'
|
||||
container_name: 'uxbox-devenv-smtp'
|
||||
image: mwader/postfix-relay
|
||||
restart: always
|
||||
environment:
|
||||
|
@ -51,14 +49,14 @@ services:
|
|||
postgres:
|
||||
image: postgres:12
|
||||
command: postgres -c config_file=/etc/postgresql.conf
|
||||
hostname: 'uxboxdev-postgres'
|
||||
container_name: 'uxboxdev-postgres'
|
||||
hostname: 'uxbox-devenv-postgres'
|
||||
container_name: 'uxbox-devenv-postgres'
|
||||
restart: always
|
||||
stop_signal: SIGINT
|
||||
ports:
|
||||
- 5432:5432
|
||||
environment:
|
||||
- POSTGRES_INITDB_ARGS="--data-checksums"
|
||||
- POSTGRES_INITDB_ARGS=--data-checksums
|
||||
- POSTGRES_DB=uxbox
|
||||
- POSTGRES_USER=uxbox
|
||||
- POSTGRES_PASSWORD=uxbox
|
||||
|
|
|
@ -8,5 +8,5 @@ alias lsf='ls -h *(.)'
|
|||
|
||||
export LEIN_FAST_TRAMPOLINE=y
|
||||
|
||||
export NVM_DIR="/home/uxbox/.nvm"
|
||||
export NVM_DIR="$HOME/.nvm"
|
||||
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
|
||||
|
|
|
@ -15,7 +15,6 @@ tmux send-keys -t uxbox './bin/start-dev' enter
|
|||
tmux rename-window -t uxbox:0 'gulp'
|
||||
tmux select-window -t uxbox:0
|
||||
tmux send-keys -t uxbox 'cd uxbox/frontend' enter C-l
|
||||
tmux send-keys -t uxbox 'if [ ! -e ./node_modules ]; then npm ci; fi' enter C-l
|
||||
tmux send-keys -t uxbox 'npx gulp watch' enter
|
||||
|
||||
tmux -2 attach-session -t uxbox
|
||||
|
|
|
@ -10,7 +10,7 @@ bindkey -e
|
|||
|
||||
autoload -U promptinit
|
||||
promptinit
|
||||
prompt zefram
|
||||
prompt suse
|
||||
|
||||
#------------------------------
|
||||
## Comp stuff
|
||||
|
@ -52,5 +52,5 @@ setopt hist_ignore_all_dups
|
|||
setopt hist_ignore_space
|
||||
|
||||
export PATH=$HOME/.local/bin:$PATH
|
||||
export NVM_DIR="/home/uxbox/.nvm"
|
||||
export NVM_DIR="$HOME/.nvm"
|
||||
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue