Skip to content

Commit

Permalink
ci: updated dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
tikazyq committed Nov 20, 2024
1 parent 2203be9 commit 874f02a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
13 changes: 5 additions & 8 deletions docker/base-image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
FROM ubuntu:22.04

# set as non-interactive
ENV DEBIAN_FRONTEND noninteractive
ENV DEBIAN_FRONTEND=noninteractive

# copy install scripts
COPY ./install /app/install
Expand Down Expand Up @@ -32,17 +32,14 @@ RUN bash /app/install/rod/rod.sh
WORKDIR /app/backend

# node path
ENV NODE_PATH /usr/lib/node_modules
ENV NODE_PATH=/usr/lib/node_modules

# timezone environment
ENV TZ Asia/Shanghai
ENV TZ=Asia/Shanghai

# language environment
ENV LC_ALL C.UTF-8
ENV LANG C.UTF-8

# goproxy
ENV GOPROXY goproxy.io,direct
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8

# frontend port
EXPOSE 8080
Expand Down
12 changes: 9 additions & 3 deletions docker/base-image/install/python/python.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
#!/bin/bash

version="3.10"
version="3.12"

# install pyenv
curl https://pyenv.run | bash

# add pyenv to path
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
source ~/.bashrc
echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc

# ensure changes take effect immediately
export PYENV_ROOT="$HOME/.pyenv"
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"

# install python ${version} via pyenv
pyenv install ${version}
Expand Down

0 comments on commit 874f02a

Please sign in to comment.