Dockerfile (658B) download
1FROM php:alpine
2
3# Install composer
4RUN apk add --no-cache curl
5RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
6
7# Create volume for the database
8VOLUME [ "/usr/src/memory-backend/var" ]
9
10# Copy the application
11COPY . /usr/src/memory-backend
12WORKDIR /usr/src/memory-backend
13
14# Install dependencies
15RUN composer install
16
17# Create the database (shouldn't really be used in production environments)
18WORKDIR /usr/src/memory-backend
19RUN ["php", "bin/console", "doctrine:schema:update", "--force"]
20
21# Run the application
22WORKDIR /usr/src/memory-backend/public
23CMD ["php", "-S", "0.0.0.0:8000"]
24
25EXPOSE 8000