Skip to content

Commit

Permalink
Refactor Dockerfile some more
Browse files Browse the repository at this point in the history
  • Loading branch information
axsuul committed Nov 16, 2024
1 parent d4c111c commit 4ea7b58
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 15 deletions.
3 changes: 1 addition & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# .dockerignore
.github/
.idea/
examples/
Expand All @@ -7,4 +6,4 @@ LICENSE
.git/
*.md
*.yml
Dockerfile
Dockerfile
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.0.0] - 2024-11-16
### Changed
- Refactored Docker image size to be smaller
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# The first stage is dedicated to building the application
FROM ruby:3.2.2-alpine as BUILD
FROM ruby:3.2.2-alpine AS build

ENV PORT=9594 \
USER=app \
Expand All @@ -8,7 +8,7 @@ ENV PORT=9594 \

WORKDIR $ROOT

# Updating system packages and installing dependencies
# Update system packages and installing dependencies
RUN apk update && apk upgrade && \
apk add --update --no-cache --virtual .build-deps \
build-base \
Expand All @@ -29,10 +29,10 @@ RUN gem install bundler && \
COPY . $ROOT/

# The second stage is responsible for preparing the runtime
FROM ruby:3.2.2-alpine as RUNTIME
FROM ruby:3.2.2-alpine AS runtime

# Copy over files from the BUILD step
COPY --from=BUILD $ROOT $ROOT
# Copy over files from the build step
COPY --from=build $ROOT $ROOT

# Set environmental variables
ENV PORT=9594 \
Expand All @@ -49,4 +49,4 @@ RUN addgroup -S $GROUP && \

USER $USER:$GROUP

CMD bundle exec puma -b tcp://0.0.0.0:$PORT
CMD bundle exec puma -b tcp://0.0.0.0:$PORT
8 changes: 4 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ PLATFORMS
x64-mingw-ucrt

DEPENDENCIES
http
prometheus-client
puma
rack
http (~> 5.1.1)
prometheus-client (~> 4.2.2)
puma (~> 6.4.0)
rack (~> 3.0.8)

RUBY VERSION
ruby 3.2.2p53
Expand Down
4 changes: 1 addition & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
version: '3.4'

services:
app:
image: axsuul/plex-media-server-exporter:2022-11-26
image: axsuul/plex-media-server-exporter
build: .
environment:
# Can be set in .env
Expand Down

0 comments on commit 4ea7b58

Please sign in to comment.