Move Dockerfile to docker directory

This commit is contained in:
riggraz
2019-12-03 23:16:34 +01:00
parent 68acccf1a4
commit d8443bf0c4
3 changed files with 13 additions and 10 deletions

View File

@@ -8,7 +8,9 @@ services:
volumes: volumes:
- ./tmp/db:/var/lib/postgresql/data - ./tmp/db:/var/lib/postgresql/data
web: web:
build: . build:
context: .
dockerfile: ./docker/app/Dockerfile
environment: environment:
- UPDATE=0 - UPDATE=0
- ENVIRONMENT - ENVIRONMENT
@@ -20,7 +22,7 @@ services:
- SHOW_LOGO - SHOW_LOGO
- POSTS_PER_PAGE - POSTS_PER_PAGE
volumes: volumes:
- .:/app - .:/astuto
ports: ports:
- "3000:3000" - "3000:3000"
depends_on: depends_on:

View File

@@ -12,7 +12,7 @@ set -e
/bin/bash ./check-env.sh /bin/bash ./check-env.sh
# Remove a potentially pre-existing server.pid for Rails. # Remove a potentially pre-existing server.pid for Rails.
rm -f /app/tmp/pids/server.pid rm -f $APP_ROOT/tmp/pids/server.pid
# Use case 1 # Use case 1
if [ "$UPDATE" = 1 ]; then if [ "$UPDATE" = 1 ]; then
@@ -32,7 +32,7 @@ if [ "$UPDATE" = 1 ]; then
# Use webpack to build JS and CSS. # Use webpack to build JS and CSS.
echo "Compiling JS and CSS with webpack..." echo "Compiling JS and CSS with webpack..."
./bin/webpack $APP_ROOT/bin/webpack
echo "Webpack compilation completed." echo "Webpack compilation completed."
exit 0 exit 0

View File

@@ -9,24 +9,25 @@ RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.d
RUN dpkg -i /google-chrome-stable_current_amd64.deb; apt-get -fy install RUN dpkg -i /google-chrome-stable_current_amd64.deb; apt-get -fy install
RUN rm /google-chrome-stable_current_amd64.deb RUN rm /google-chrome-stable_current_amd64.deb
RUN mkdir /app ENV APP_ROOT /astuto
WORKDIR /app RUN mkdir ${APP_ROOT}
WORKDIR ${APP_ROOT}
# Launch processes in Procfile # Launch processes in Procfile
RUN gem install foreman RUN gem install foreman
# Copy Gemfile and install gems # Copy Gemfile and install gems
COPY Gemfile* /app/ COPY Gemfile* ${APP_ROOT}/
RUN bundle install RUN bundle install
# Copy package.json and install packages # Copy package.json and install packages
COPY package.json yarn.lock /app/ COPY package.json yarn.lock ${APP_ROOT}/
RUN yarn install --check-files RUN yarn install --check-files
COPY . /app COPY . ${APP_ROOT}
# Add a script to be executed every time the container starts. # Add a script to be executed every time the container starts.
ENTRYPOINT ["/app/docker-entrypoint.sh"] ENTRYPOINT ["./docker-entrypoint.sh"]
EXPOSE 3000 EXPOSE 3000