-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add docker-release.sh in order to build and push to Docker hub #463
Conversation
Hi, Thanks for the updated PR. As the docker files present in this repository are just for evaluation (not suitable for production), it will build an image for evaluation only. |
Right, but for production how do you plan to build the docker image ? |
Hard to say, I have no experience deploying with Docker in production :/ |
I've read about https://docs.docker.com/docker-hub/builds/link-source/ |
It's possible to let GitHub build docker image automatically every time you merge on You can create a GitHub action by using this link (I've made some test in my fork) : |
Another example for GitHub workflows : |
Docker images are based on ubuntu, but size is bigger than GiB, there's a way to reduce, other docker's project are smaller |
I built them for my personal usage, with these changes, reducing the image sizes to:
diff --git a/.dockerignore b/.dockerignore
index db3149ba..24c43d49 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -10,3 +10,5 @@ docker-compose-dev.yml
Makefile.custom.config
*.log
data
+fittrackee_client
+db
diff --git a/Dockerfile b/Dockerfile
index ac910520..9da0f2f5 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,4 +1,4 @@
-FROM python:3.10
+FROM python:3.10-slim
# set working directory
RUN mkdir -p /usr/src/app
@@ -11,8 +11,8 @@ COPY . /usr/src/app
ENV VIRTUAL_ENV=/opt/venv
RUN python3 -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
-RUN pip install --upgrade pip
-RUN pip install poetry
+RUN pip install --no-cache-dir --upgrade pip
+RUN pip install --no-cache-dir poetry
RUN . $VIRTUAL_ENV/bin/activate && poetry install --no-interaction --quiet
# run fittrackee server
diff --git a/fittrackee_client/Dockerfile b/fittrackee_client/Dockerfile
index e1c9e5f3..9c929f89 100644
--- a/fittrackee_client/Dockerfile
+++ b/fittrackee_client/Dockerfile
@@ -1,9 +1,8 @@
-FROM node:18
+FROM node:18-alpine
MAINTAINER SamR1@users.noreply.github.com
# set working directory
-RUN mkdir /usr/src/app
WORKDIR /usr/src/app
# add `/usr/src/app/node_modules/.bin` to $PATH
@@ -18,7 +17,8 @@ ENV VITE_APP_API_URL $VITE_APP_API_URL
# install dependencies
COPY package.json /usr/src/app/package.json
COPY yarn.lock /usr/src/app/yarn.lock
-RUN yarn install --silent
+RUN yarn install --silent && yarn cache clean --force
+RUN npm run build
# copy source
COPY . /usr/src/app/ |
Based on work of @jovandeginste see : SamR1#463 (comment)
Based on work of @jovandeginste see : SamR1#463 (comment)
Based on work of @jovandeginste see : SamR1#463 (comment)
Based on work of @jovandeginste see : SamR1#463 (comment)
Based on work of @jovandeginste see : SamR1#463 (comment)
Based on work of @jovandeginste see : SamR1#463 (comment)
Based on work of @jovandeginste see : SamR1#463 (comment)
Based on work of @jovandeginste see : SamR1#463 (comment)
Based on work of @jovandeginste see : SamR1#463 (comment)
Based on work of @jovandeginste see : SamR1#463 (comment)
Based on work of @jovandeginste see : SamR1#463 (comment)
Based on work of @jovandeginste see : SamR1#463 (comment)
Based on work of @jovandeginste see : SamR1#463 (comment)
Based on work of @jovandeginste see : SamR1#463 (comment)
Based on work of @jovandeginste see : SamR1#463 (comment)
Based on work of @jovandeginste see : SamR1#463 (comment)
Based on work of @jovandeginste see : SamR1#463 (comment)
Based on work of @jovandeginste see : SamR1#463 (comment)
Based on work of @jovandeginste see : SamR1#463 (comment)
Based on work of @jovandeginste see : SamR1#463 (comment)
#126