Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
Replaced contents of dockerfile with response from correctiong
  • Loading branch information
wickedyoda committed Aug 15, 2024
1 parent 80013d4 commit 37f0c27
Showing 1 changed file with 41 additions and 42 deletions.
83 changes: 41 additions & 42 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,60 +1,59 @@
# Build Vue
# Build Vue.js frontend
FROM node:14.5.0-alpine as build-stage

ARG VUE_APP_VERSION
ENV VUE_APP_VERSION=${VUE_APP_VERSION}

WORKDIR /app
COPY ./frontend/package*.json ./
RUN npm install
COPY ./frontend/ .
RUN npm run build
RUN npm install --verbose
COPY ./frontend/ ./
RUN npm run build --verbose

# Setup Container and install Flask
# Setup Container and install Flask backend
FROM lsiobase/alpine:3.12 as deploy-stage
# MAINTANER Your Name "info@selfhosted.pro"
# MAINTAINER Your Name "info@selfhosted.pro"

# Set Variables
# Set environment variables
ENV PYTHONIOENCODING=UTF-8
ENV THEME=Default

WORKDIR /api
COPY ./backend/requirements.txt .

# Install Dependancies
RUN \
echo "**** install build packages ****" && \
apk add --no-cache --virtual=build-dependencies \
g++ \
make \
postgresql-dev \
python3-dev \
libffi-dev \
ruby-dev &&\
echo "**** install packages ****" && \
apk add --no-cache \
python3 \
py3-pip \
mysql-dev \
postgresql-dev \
mysql-dev \
nginx &&\
gem install sass &&\
echo "**** Installing Python Modules ****" && \
pip3 install wheel &&\
pip3 install -r requirements.txt &&\
# Delay cleaning up until all tasks are done
COPY ./backend/requirements.txt ./

# Install build dependencies
RUN apk add --no-cache --virtual=build-dependencies \
g++ \
make \
postgresql-dev \
python3-dev \
libffi-dev \
ruby-dev

# Install main packages
RUN apk add --no-cache \
python3 \
py3-pip \
mysql-dev \
postgresql-dev \
nginx

# Install SASS via gem
RUN gem install sass --verbose

# Install Python modules
RUN pip3 install wheel --verbose
RUN pip3 install -r requirements.txt --verbose

# Clean up build dependencies
RUN apk del --purge build-dependencies && \
rm -rf /root/.cache /tmp/*
rm -rf /root/.cache /tmp/*

COPY ./backend/api ./
COPY ./backend/alembic /alembic
COPY root ./backend/alembic.ini /
# Copy the backend code
COPY ./backend/ ./

# Vue
COPY --from=build-stage /app/dist /app
COPY nginx.conf /etc/nginx/
# Add any additional necessary setup commands here

# Expose
VOLUME /config
EXPOSE 8000
# Expose ports and define the command to run the application
EXPOSE 5000
CMD ["python3", "app.py"]

0 comments on commit 37f0c27

Please sign in to comment.