mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-05 20:11:13 +08:00
Enhance Docker setup: Add shared volume for frontend files and update Dockerfile for dependencies
Changes: - Updated `docker-compose.yml` to include a new shared volume `frontend-dist` for frontend files. - Modified the `nofx` service command to copy frontend files to the shared volume. - Updated `Dockerfile` to use Go 1.25 and added necessary build dependencies for TA-Lib installation. These changes improve the Docker environment by facilitating shared access to frontend assets and ensuring the build process is up-to-date with the latest Go version.
This commit is contained in:
32
Dockerfile
32
Dockerfile
@@ -1,20 +1,30 @@
|
||||
# Multi-stage build for NOFX AI Trading System
|
||||
FROM golang:1.24-alpine AS backend-builder
|
||||
FROM golang:1.25-alpine AS backend-builder
|
||||
|
||||
# Install build dependencies including TA-Lib
|
||||
RUN apk add --no-cache \
|
||||
RUN apk update && \
|
||||
apk add --no-cache \
|
||||
git \
|
||||
make \
|
||||
gcc \
|
||||
g++ \
|
||||
musl-dev \
|
||||
wget \
|
||||
tar
|
||||
tar \
|
||||
autoconf \
|
||||
automake
|
||||
|
||||
# Install TA-Lib
|
||||
RUN wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz && \
|
||||
tar -xzf ta-lib-0.4.0-src.tar.gz && \
|
||||
cd ta-lib && \
|
||||
if [ "$(uname -m)" = "aarch64" ]; then \
|
||||
CONFIG_GUESS=$(find /usr/share -name config.guess | head -1) && \
|
||||
CONFIG_SUB=$(find /usr/share -name config.sub | head -1) && \
|
||||
cp "$CONFIG_GUESS" config.guess && \
|
||||
cp "$CONFIG_SUB" config.sub && \
|
||||
chmod +x config.guess config.sub; \
|
||||
fi && \
|
||||
./configure --prefix=/usr && \
|
||||
make && \
|
||||
make install && \
|
||||
@@ -56,8 +66,9 @@ RUN npm run build
|
||||
# Final stage
|
||||
FROM alpine:latest
|
||||
|
||||
# Install runtime dependencies
|
||||
RUN apk add --no-cache \
|
||||
# Update package index and install runtime dependencies
|
||||
RUN apk update && \
|
||||
apk add --no-cache \
|
||||
ca-certificates \
|
||||
tzdata \
|
||||
wget \
|
||||
@@ -65,12 +76,21 @@ RUN apk add --no-cache \
|
||||
make \
|
||||
gcc \
|
||||
g++ \
|
||||
musl-dev
|
||||
musl-dev \
|
||||
autoconf \
|
||||
automake
|
||||
|
||||
# Install TA-Lib runtime
|
||||
RUN wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz && \
|
||||
tar -xzf ta-lib-0.4.0-src.tar.gz && \
|
||||
cd ta-lib && \
|
||||
if [ "$(uname -m)" = "aarch64" ]; then \
|
||||
CONFIG_GUESS=$(find /usr/share -name config.guess | head -1) && \
|
||||
CONFIG_SUB=$(find /usr/share -name config.sub | head -1) && \
|
||||
cp "$CONFIG_GUESS" config.guess && \
|
||||
cp "$CONFIG_SUB" config.sub && \
|
||||
chmod +x config.guess config.sub; \
|
||||
fi && \
|
||||
./configure --prefix=/usr && \
|
||||
make && \
|
||||
make install && \
|
||||
|
||||
Reference in New Issue
Block a user