jshimko / meteor-launchpad

A base Docker image for Meteor applications.
https://hub.docker.com/r/jshimko/meteor-launchpad/
MIT License
276 stars 152 forks source link

I forked this repo and made possible Meteor 3 deployment. #151

Open gustawdaniel opened 9 months ago

gustawdaniel commented 9 months ago

How to migrate.

Replace:

FROM jshimko/meteor-launchpad:latest as build

by

FROM gustawdaniel/meteor-launchpad:latest as build

in your Dockerfile.

If you have to deploy meteor 2 add

PYTHON_VERSION=2.7

in launchpad.conf

By default I am using 3.6.0

Repo:

https://github.com/gustawdaniel/meteor-launchpad/tree/master

gustawdaniel commented 9 months ago

@jshimko we can add this to your repo if you want. There is open PR to install python by conda

gustawdaniel commented 9 months ago

Now PYTHON_VERSION isn't required in launchpad.conf because we can derive it from node js version

gustawdaniel commented 3 months ago

Now meteor 3 is installed by npx instead of bash script

gustawdaniel commented 3 months ago

I created simplified Dockerfile and resigned from instalation nodejs during meteor app build. There is my new Dockerfile for stable meteor v3

FROM node:20-bullseye-slim

# Install dependencies
RUN apt-get update && apt-get install -y \
    curl \
    build-essential \
    && rm -rf /var/lib/apt/lists/*

# Create a non-root user and set permissions
RUN useradd --create-home --shell /bin/bash meteoruser
WORKDIR /opt/meteor
COPY . .

RUN chown -R meteoruser:meteoruser /opt/meteor
RUN mkdir -p /opt/dist && chown -R meteoruser:meteoruser /opt/dist

# Switch to the non-root user
USER meteoruser

# Install Meteor using npx and other dependencies
RUN npx meteor
RUN npm ci

# Build the Meteor application
RUN /home/meteoruser/.meteor/meteor build --directory /opt/dist --server-only

# Install server dependencies for the built app
RUN cd /opt/dist/bundle/programs/server && npm install --omit=dev --verbose

# Expose the Meteor default port
EXPOSE 3000

# Switch to the non-root user for running the app
USER meteoruser
WORKDIR /opt/dist/bundle

# Start the Meteor application
CMD ["node", "main.js"]