forked from SelfhostedPro/Yacht
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replaced contents of dockerfile with response from correctiong
- Loading branch information
1 parent
80013d4
commit 37f0c27
Showing
1 changed file
with
41 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |